The GetMenuItemCount function determines the number of items in the specified menu.
int GetMenuItemCount(
HMENU hMenu |
// handle of 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.