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 of menu | 
| int nPos | // position of menu item | 
| ); | 
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.