Jump to content

MM ITEMPOSITIONFROMID

From EDM2

This message returns the index of a menu item of a particular identity.

Syntax

param1
USHORT usitem;             /* Item identifier. */
USHORT usincludesubmenus; /* Include submenus indicator. */

param2
ULONG ulReserved;        /* Reserved value, should be 0. */

Parameters

usitem (USHORT) - input
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.
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.
ulReserved (ULONG) - input
Reserved value, should be 0.

Returns

sIndex (SHORT) - return
Item index.
MIT_NONE: Item does not exist.
Other: Item index.

Remarks=

The menu control window procedure responds to this message by setting sIndex to the zero-based index of the item identified by usitem.

Note
It must be sent, not posted, to the menu control.
Note
If MM_ITEMPOSITIONFROMID is sent to a window that has been

destroyed, 0 is returned. The existence of an invalid window handle can be verified through WinIsWindow.

Default Processing

The default window procedure does not expect to receive this message and therefore takes no action on it, other than to set sIndex to the default value of MIT_NONE.