ChildWindowFromPoint

  HWND ChildWindowFromPoint(hwndOwner, pt)    
  HWND hwndOwner; /* 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

hwndOwner

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 */

LONG x;

LONG y;

} POINT;

Return Value

The return value identifies the child window 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

This function will return the handle of a hidden, disabled, or transparent child window that contains the specified point.

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