MENUINFO structure (winuser.h)

Contains information about a menu.

Syntax

typedef struct tagMENUINFO {
  DWORD     cbSize;
  DWORD     fMask;
  DWORD     dwStyle;
  UINT      cyMax;
  HBRUSH    hbrBack;
  DWORD     dwContextHelpID;
  ULONG_PTR dwMenuData;
} MENUINFO, *LPMENUINFO;

Members

cbSize

Type: DWORD

The size of the structure, in bytes. The caller must set this member to sizeof(MENUINFO).

fMask

Type: DWORD

Indicates the members to be retrieved or set (except for MIM_APPLYTOSUBMENUS). This member can be one or more of the following values.

Value Meaning
MIM_APPLYTOSUBMENUS
0x80000000
Settings apply to the menu and all of its submenus. SetMenuInfo uses this flag and GetMenuInfo ignores this flag
MIM_BACKGROUND
0x00000002
Retrieves or sets the hbrBack member.
MIM_HELPID
0x00000004
Retrieves or sets the dwContextHelpID member.
MIM_MAXHEIGHT
0x00000001
Retrieves or sets the cyMax member.
MIM_MENUDATA
0x00000008
Retrieves or sets the dwMenuData member.
MIM_STYLE
0x00000010
Retrieves or sets the dwStyle member.

dwStyle

Type: DWORD

The menu style. This member can be one or more of the following values.

Value Meaning
MNS_AUTODISMISS
0x10000000
Menu automatically ends when mouse is outside the menu for approximately 10 seconds.
MNS_CHECKORBMP
0x04000000
The same space is reserved for the check mark and the bitmap. If the check mark is drawn, the bitmap is not. All checkmarks and bitmaps are aligned. Used for menus where some items use checkmarks and some use bitmaps.
MNS_DRAGDROP
0x20000000
Menu items are OLE drop targets or drag sources. Menu owner receives WM_MENUDRAG and WM_MENUGETOBJECT messages.
MNS_MODELESS
0x40000000
Menu is modeless; that is, there is no menu modal message loop while the menu is active.
MNS_NOCHECK
0x80000000
No space is reserved to the left of an item for a check mark. The item can still be selected, but the check mark will not appear next to the item.
MNS_NOTIFYBYPOS
0x08000000
Menu owner receives a WM_MENUCOMMAND message instead of a WM_COMMAND message when the user makes a selection. MNS_NOTIFYBYPOS is a menu header style and has no effect when applied to individual sub menus.

cyMax

Type: UINT

The maximum height of the menu in pixels. When the menu items exceed the space available, scroll bars are automatically used. The default (0) is the screen height.

hbrBack

Type: HBRUSH

A handle to the brush to be used for the menu's background.

dwContextHelpID

Type: DWORD

The context help identifier. This is the same value used in the GetMenuContextHelpId and SetMenuContextHelpId functions.

dwMenuData

Type: ULONG_PTR

An application-defined value.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header winuser.h (include Windows.h)

See also

Menus Overview