ChildWindowFromPointEx function

Determines which, if any, of the child windows belonging to the specified parent window contains the specified point. The function can ignore invisible, disabled, and transparent child windows. The search is restricted to immediate child windows. Grandchildren and deeper descendants are not searched.

Syntax

HWND ChildWindowFromPointEx(
  HWND  hwnd,
  POINT pt,
  UINT  flags
);

Parameters

hwnd

Type: HWND

A handle to the parent window.

pt

Type: POINT

A structure that defines the client coordinates (relative to hwndParent) of the point to be checked.

flags

Type: UINT

The child windows to be skipped. This parameter can be one or more of the following values.

Value Meaning
CWP_ALL
0x0000
Does not skip any child windows
CWP_SKIPDISABLED
0x0002
Skips disabled child windows
CWP_SKIPINVISIBLE
0x0001
Skips invisible child windows
CWP_SKIPTRANSPARENT
0x0004
Skips transparent child windows

Return Value

Type: Type: HWND

The return value is a handle to the first child window that contains the point and meets the criteria specified by uFlags. If the point is within the parent window but not within any child window that meets the criteria, the return value is a handle to the parent window. If the point lies outside the parent window or if the function fails, the return value is NULL.

Remarks

The system maintains an internal list that contains the handles of the child windows associated with a parent window. The order of the handles in the list depends on the Z order of the child windows. If more than one child window contains the specified point, the system returns a handle to the first window in the list that contains the point and meets the criteria specified by uFlags.

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

Conceptual

Other Resources

POINT

Reference

WindowFromPoint

Windows