WindowFromPoint function

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

Syntax

HWND WindowFromPoint(
  POINT Point
);

Parameters

Point

Type: POINT

The point to be checked.

Return Value

Type: 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

   
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

See Also

ChildWindowFromPoint

Conceptual

Other Resources

POINT

Reference

WindowFromDC

Windows