GetMenuItemCount

The GetMenuItemCount function determines the number of items in the specified menu.

int GetMenuItemCount(
  HMENU hMenu  // handle to menu
);
 

Parameters

hMenu
Handle to the handle to the menu to be examined.

Return Values

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.

QuickInfo

  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.

See Also

Menus Overview, Menu Functions, GetMenuItemID