The GetMenuItemCount function determines the number of items in the specified menu.
int GetMenuItemCount(
HMENU hMenu // handle to menu
);
If the function succeeds, the return value specifies the number of items in the menu.
If the function fails, the return value is –1. To get extended error information, call GetLastError.
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.
Menus Overview, Menu Functions, GetMenuItemID