Help Center

MenuGetRectfunction

Calculates the size of a menu bar or a drop-down menu.

Windowsfunctiondocumented

Syntax

FUNCTION MenuGetRect (BYVAL hWin AS HWND, BYVAL hmenu AS HMENU) AS RECT

Parameters

NameDescription
hWinHandle of the windowor dialog that owns the menu. If this value is NULL and the hMenu parameter represents a popup menu, the function will find the menu window.
hmenuThe one-based relative position of the menu item whose identifier is to be retrieved.
prcmenuA pointer to a RECT structure that receives the bounding rectangle of the specified menu item expressed in screen coordinates.

Return value

If the function succeeds, the return value is 0. If the function fails, the return value is a system error code.

The second overloaded function returns a RECT structure directly.

Description

Calculates the size of a menu bar or a drop-down menu.

Reference

  • Defined in AfxNova/AfxMenu.inc:1517
  • Documented in Windows/Windows GUI/Menu Procedures.md
  • Topic: About Menus