Export (0) Print
Expand All

MenuItemFromPoint function

Determines which menu item, if any, is at the specified location.

Syntax


int WINAPI MenuItemFromPoint(
  _In_opt_  HWND hWnd,
  _In_      HMENU hMenu,
  _In_      POINT ptScreen
);

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 the menu containing the menu items to hit test.

ptScreen [in]

Type: POINT

A structure that specifies the location to test. If hMenu specifies a menu bar, this parameter is in window coordinates. Otherwise, it is in client coordinates.

Return value

Type: int

Returns the zero-based position of the menu item at the specified location or -1 if no menu item is at the specified location.

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft