Export (0) Print
Expand All
5 out of 9 rated this helpful - Rate this topic

GetMenu function

Retrieves a handle to the menu assigned to the specified window.

Syntax


HMENU WINAPI GetMenu(
  _In_  HWND hWnd
);

Parameters

hWnd [in]

Type: HWND

A handle to the window whose menu handle is to be retrieved.

Return value

Type: HMENU

The return value is a handle to the menu. If the specified window has no menu, the return value is NULL. If the window is a child window, the return value is undefined.

Remarks

GetMenu does not work on floating menu bars. Floating menu bars are custom controls that mimic standard menus; they are not menus. To get the handle on a floating menu bar, use the Active Accessibility APIs.

Examples

For an example, see Adding Lines and Graphs to a Menu.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
GetSubMenu
SetMenu
Conceptual
Menus

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.