windows_programming_notes.nbk: Home | Index | Next Page: WM_MENUCOMMAND | Previous Page: WM_MEASUREITEM


 WM_MENUCHAR

The WM_MENUCHAR message is 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.

A window receives this message through its WindowProc function.

    LRESULT CALLBACK WindowProc(
      HWND hwnd,       // handle to window
      UINT uMsg,       // WM_MENUCHAR
      WPARAM wParam,   // character code (TCHAR), type
      LPARAM lParam    // handle to menu (HMENU)
    );

Parameters

Return Values

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

Value Meaning MNC_IGNORE Informs the system that it should discard the character the user pressed and create a short beep on the system speaker. MNC_CLOSE Informs the system that it should close the active menu. MNC_EXECUTE 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_SELECT 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

  Windows NT/2000 or later: Requires Windows NT 3.1 or later.
  Windows 95/98/Me: Requires Windows 95 or later.
  Header: Declared in Winuser.h; include Windows.h.

windows_programming_notes.nbk: Home | Index | Next Page: WM_MENUCOMMAND | Previous Page: WM_MEASUREITEM


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time