WM_MENUCHAR message

Sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu.

#define WM_MENUCHAR                     0x0120

Parameters

wParam

The low-order word specifies the character code that corresponds to the key the user pressed.

The high-order word specifies the active menu type. This parameter can be one of the following values.

Value Meaning
MF_POPUP
0x00000010L
A drop-down menu, submenu, or shortcut menu.
MF_SYSMENU
0x00002000L
The window menu.

lParam

A handle to the active menu.

Return value

An application that processes this message should return one of the following values in the high-order word of the return value.

Return code/value Description
MNC_CLOSE
1
Informs the system that it should close the active menu.
MNC_EXECUTE
2
Informs the system that it should choose the item specified in the low-order word of the return value. The owner window receives a WM_COMMAND message.
MNC_IGNORE
0
Informs the system that it should discard the character the user pressed and create a short beep on the system speaker.
MNC_SELECT
3
Informs the system that it should select the item specified in the low-order word of the return value.

Remarks

The low-order word is ignored if the high-order word contains 0 or 1.

An application should process this message when an accelerator is used to select a menu item that displays a bitmap.

Requirements

Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

Reference

HIWORD

LOWORD

Conceptual

Keyboard Accelerators