GetMenuBarInfo function

Retrieves information about the specified menu bar.

Syntax

BOOL GetMenuBarInfo(
  HWND         hwnd,
  LONG         idObject,
  LONG         idItem,
  PMENUBARINFO pmbi
);

Parameters

hwnd

Type: HWND

A handle to the window (menu bar) whose information is to be retrieved.

idObject

Type: LONG

The menu object. This parameter can be one of the following values.

Value Meaning
OBJID_CLIENT
((LONG)0xFFFFFFFC)
The popup menu associated with the window.
OBJID_MENU
((LONG)0xFFFFFFFD)
The menu bar associated with the window (see the GetMenu function).
OBJID_SYSMENU
((LONG)0xFFFFFFFF)
The system menu associated with the window (see the GetSystemMenu function).

idItem

Type: LONG

The item for which to retrieve information. If this parameter is zero, the function retrieves information about the menu itself. If this parameter is 1, the function retrieves information about the first item on the menu, and so on.

pmbi

Type: PMENUBARINFO

A pointer to a MENUBARINFO structure that receives the information. Note that you must set the cbSize member to sizeof(MENUBARINFO) before calling this function.

Return Value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

GetMenu

GetSystemMenu

MENUBARINFO

Menus

Reference