GetMenuItemID

Syntax

WORD GetMenuItemID(hMenu,nPos)

This function obtains the menu-item identifier for a menu item located at the position defined by the nPos parameter.

Parameter Type/Description  
hMenu HMENU Identifies a handle to the pop-up menu that contains the item whose ID is being retrieved.  
nPos int Specifies the position (zero-based) of the menu item whose ID is being retrieved.  

Return Value

The return value specifies the item ID for the specified item in a pop-up menu if the function is successful; if hMenu is NULL or if the specified item is a pop-up menu (as opposed to an item within the pop-up menu), the return value is –1.