User32ChildWindowFromPoint(IntPtr, Point) Method

Determines which, if any, of the child windows belonging to a parent window contains the specified point.

The search is restricted to immediate child windows. Grandchildren, and deeper descendant windows are not searched.

To skip certain child windows, use the ChildWindowFromPointEx(IntPtr, NativePoint, WindowSkipOptions) function.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", ExactSpelling = true)]
public static IntPtr ChildWindowFromPoint(
	IntPtr hWndParent,
	Point pt
)

Parameters

hWndParent  IntPtr
A handle to the parent window.
pt  Point
A structure that defines the client coordinates, relative to hWndParent, of the point to be checked.

Return Value

IntPtr
The return value is a handle to the child window that contains the point, even if the child window is hidden or disabled.

If the point lies outside the parent window, the return value is Zero.

If the point is within the parent window but not within any child window, the return value is a handle to the parent window.

Remarks

See Also