Help Center

GetHandlefunction

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

Windowsfunctiondoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

FUNCTION GetHandle (BYVAL hWin AS HWND) AS HMENU

Parameters

NameDescription
hWinA handle to the window or dialog whose menu handle is to be retrieved.

Return value

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.

Description

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

Remarks

GetHandle 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. The Windows API GetMenu function can be used instead of CMenu.GetHandle.

Reference

  • Documented in Windows/WIndows Controls/CMenu Class.md
  • Topic: About Menus