The information in this article applies to:
SUMMARYIn an MDI-like application, the user must be allowed to pull down menus in the parent window by using menu mnemonics even though the child window or one of its children may have the focus. This can be done by creating child windows without a system menu or by processing the WM_MENUCHAR and WM_SYSCOMMAND/SC_KEYMENU messages to programatically pull down the parent's menu. MORE INFORMATION
If a child window with a system menu has the focus and the user attempts to
access the parent's menu with the keyboard using the menu mnemonic
(ALT+mnemonic character), Windows will beep and the parent's menu will not
be pulled down. This problem occurs because the parent window does not have
the focus and because the window with the focus does not have a menu
corresponding to the mnemonic. (Child windows cannot have menus other than
the system menu.)
WM_MENUCHAR is sent to the child window when the user presses a key
sequence that does not match any of the predefined mnemonics in the current
menu. wParam contains the mnemonic character. The child window posts a
WM_SYSCOMMAND/SC_KEYMENU message to the parent whose menu is to be dropped
down, with lParam set to the character that corresponds to the menu
mnemonic.
The above code can also be used if the child window with the focus does not have a system menu but an intermediate child window with a system menu exists between the child with the focus and the ancestor whose menu is to be dropped. In this case, the code would be placed in the intermediate window's window procedure. Additional query words:
Keywords : kbMDI kbNTOS kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS kbWndw kbWndwMsg |
Last Reviewed: January 26, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |