GetMenuItemID

The GetMenuItemID function retrieves the menu item identifier of a menu item located at the specified position in a menu.

UINT GetMenuItemID(
  HMENU hMenu,  // handle to menu
  int nPos      // position of menu item
);
 

Parameters

hMenu
Handle to the menu that contains the item whose identifier is to be retrieved.
nPos
Specifies the zero-based relative position of the menu item whose identifier is to be retrieved.

Return Values

The return value specifies the identifier of the given menu item. If the menu item identifier is NULL or if the specified item opens a submenu, the return value is 0xFFFFFFFF.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also

Menus Overview, Menu Functions, GetMenuItemCount