MM_SELECTITEM
This message selects or deselects a menu item.
Syntax
param1 SHORT sitem; /* Item identifier. */ USHORT usincludesubmenus; /* Include submenus indicator. */ param2 USHORT usReserve; /* Reserved value, should be 0. */ USHORT usdismissed; /* Dismissed flag. */
Parameters
- sitem (SHORT) - input
- Item identifier.
- MIT_NONE: Deselect all the items in the menu.
- Other: Item identifier.
- usincludesubmenus (USHORT) - input
- Include submenus indicator.
- TRUE: If the menu does not have an item with the specified identifier, search
- the submenus and subdialogs of the menu for an item with the specified identifier
- and select or deselect it.
- FALSE: If the menu does not have an item with the specified identifier, do not
- search the submenus and subdialogs of the menu for an item with the specified
- identifier.
- TRUE: If the menu does not have an item with the specified identifier, search
- usReserve (USHORT) - input
- Reserved value, should be 0.
- usdismissed (USHORT) - input
- Dismissed flag.
- TRUE: Dismiss the menu.
- FALSE: Do not dismiss the menu.
Returns
- rc (BOOL) - return
- Success indicator.
- TRUE: A selection has been made, or sitem is MIT_NONE.
- FALSE: A selection has not been made, or a deselection has been made, or sitem is
- not MIT_NONE.
Remarks
The menu control window procedure responds to this message by setting the selection state of the (sub)menu which contains the specified item to indicate that the item is selected or deselected. If usincludesubmenus is set to TRUE, the selection state of the (sub)menu owning the submenu which contains the specified item is also set. This process continues up the menu hierarchy until the top level menu is reached.
If an item is selected, and usdismissed is set to TRUE, a WM_COMMAND, [[WM_ SYSCOMMAND]], or WM_HELP message, as appropriate, is posted to the owner, and the menu is dismissed.
Note: This message must be sent, not posted, to the menu control.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it, other than to set rc to the default value of FALSE.