ChildWindowFromPoint

2.x

  HWND ChildWindowFromPoint(hwndParent, pt)    
  HWND hwndParent; /* handle of parent window */
  POINT pt; /* structure with point coordinates */

The ChildWindowFromPoint function determines which, if any, of the child windows belonging to the given parent window contains the specified point.

Parameters

hwndParent

Identifies the parent window.

pt

Specifies a POINT structure that defines the client 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 child window (hidden, disabled, or transparent) that contains the point, if the function is successful. If the given point lies outside the parent window, the return value is NULL. If the point is within the parent window but is not contained within any child window, the return value is the handle of the parent window.

Comments

More than one window may contain the given point, but Windows returns the handle only of the first window encountered that contains the point.

See Also

WindowFromPoint