The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu.
WM_NEXTMENU nVirtKey = (int) wParam; pmdin = (LPMDINEXTMENU) lParam;
In responding to this message, the application can specify the menu to switch to in the hmenuNext member of MDINEXTMENU and the window to receive the menu notification messages in the hwndNext member of the MDINEXTMENU structure. You must set both members for the changes to take effect (they are initially NULL).