WindowFromPoint function (winuser.h)

Retrieves a handle to the window that contains the specified point.

Syntax

HWND WindowFromPoint(
  [in] POINT Point
);

Parameters

[in] Point

Type: POINT

The point to be checked.

Return value

Type: HWND

The return value is a handle to the window that contains the point. If no window exists at the given point, the return value is NULL. If the point is over a static text control, the return value is a handle to the window under the static text control.

Remarks

The WindowFromPoint function does not retrieve a handle to a hidden or disabled window, even if the point is within the window. An application should use the ChildWindowFromPoint function for a nonrestrictive search.

Examples

For an example, see "Interface from Running Object Table" in About Text Object Model.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll
API set ext-ms-win-ntuser-window-l1-1-1 (introduced in Windows 8.1)

See also

ChildWindowFromPoint

Conceptual

Other Resources

POINT

Reference

WindowFromDC

Windows