The MenuItemFromPoint function determines which menu item, if any, is at the specified location.
UINT WINAPI MenuItemFromPoint(
HWND hWnd,
HMENU hMenu,
POINT ptScreen
);
Windows NT 5.0 and Windows 98: If this value is NULL and the hMenu parameter represents a popup menu, the function will find the menu window.
Returns the zero-based position of the menu item at the specified location or –1 if no menu item is at the specified location.
Windows NT: Requires version 4.0 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Menus Overview, Menu Functions, POINT