WM_MENUCHAR

This message is sent when the user presses a menu mnemonic character that doesn't match any of the predefined mnemonics in the current menu. It is sent to the window that owns the menu.

Parameter Description  

wParam Contains the ASCII character that the user pressed.  
lParam The high-order word contains a handle to the selected menu. The low-order word contains the MF_POPUP flag if the menu is a pop-up menu. It contains the MF_SYSMENU flag if the menu is a System menu.  

Return Value

The high-order word of the return value contains one of the following command codes:

Code Meaning  

0 Informs Windows that it should discard the character that the user pressed, and creates a short beep on the system speaker.  
1 Informs Windows that it should close the current menu.  
2 Informs Windows that the low-order word of the return value contains the menu item-number for a specific item. This item is selected by Windows.  

The low-order word is ignored if the high-order word contains zero or 1. Applications should process this message when accelerators are used to select bitmaps placed in a menu.