Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

GetMenuItemRect function

Retrieves the bounding rectangle for the specified menu item.

Syntax


BOOL WINAPI GetMenuItemRect(
  _In_opt_  HWND hWnd,
  _In_      HMENU hMenu,
  _In_      UINT uItem,
  _Out_     LPRECT lprcItem
);

Parameters

hWnd [in, optional]

Type: HWND

A handle to the window containing the menu.

If this value is NULL and the hMenu parameter represents a popup menu, the function will find the menu window.

hMenu [in]

Type: HMENU

A handle to a menu.

uItem [in]

Type: UINT

The zero-based position of the menu item.

lprcItem [out]

Type: LPRECT

A pointer to a RECT structure that receives the bounding rectangle of the specified menu item expressed in screen coordinates.

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, use the GetLastError function.

Remarks

In order for the returned rectangle to be meaningful, the menu must be popped up if a popup menu or attached to a window if a menu bar. Menu item positions are not determined until the menu is displayed.

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

Menus

 

 

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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.