WindowFromPoint

2.x

  HWND WindowFromPoint(pt)    
  POINT pt; /* structure with point, */  

The WindowFromPoint function retrieves the handle of the window that contains the specified point.

Parameters

pt

Specifies a POINT structure that defines the screen coordinates of the point to be checked. The POINT structure has the following form:

typedef struct tagPOINT {   /* pt */
   int x;
   int y;
} POINT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

The return value is the handle of the window in which the point lies, if the function is successful. The return value is NULL if no window exists at the specified point.

Comments

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

See Also

ChildWindowFromPoint