windows_programming_notes.nbk: Home | Index | Next Page: WM_MENUSELECT | Previous Page: WM_MENUCHAR


 WM_MENUCOMMAND

The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.

Syntax

    WM_MENUCOMMAND
        WPARAM wParam
        LPARAM lParam;

Parameters

Return Value

No return value.

Remarks

The WM_MENUCOMMAND message gives you a handle to the menu—so you can access the menu data in the MENUINFO structure—and also gives you the index of the selected item, which is typically what applications need. In contrast, the WM_COMMAND message gives you the menu item identifier.

The WM_MENUCOMMAND message is sent only for menus that are defined with the MNS_NOTIFYBYPOS flag set in the dwStyle member of the MENUINFO structure.

Notification Requirements


windows_programming_notes.nbk: Home | Index | Next Page: WM_MENUSELECT | Previous Page: WM_MENUCHAR


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