Show / Hide Table of Contents

Method wnd.fromXY(+ 1 overload)


Overload

Gets visible top-level window or control from point.

public static wnd fromXY(POINT p, WXYFlags flags = 0)
Parameters
p  (POINT)

Coordinates. Tip: To specify coordinates relative to the right, bottom, work area or a non-primary screen, use Coord.Normalize, like in the example.

flags  (WXYFlags)
Returns
wnd

Remarks

Unlike API WindowFromPhysicalPoint etc, this function: does not skip disabled controls; always skips transparent control like group box if a smaller sibling is there. All this is not true with flag Raw.

Examples

Find window at 100 200.

var w = wnd.FromXY((100, 200), WXYFlags.NeedWindow);
print.it(w);

Find window or control at 50 from left and 100 from bottom of the work area.

var w = wnd.FromXY(Coord.Normalize(50, ^100, workArea: true));
print.it(w);

Overload(top)

Gets visible top-level window or control from point.

public static wnd fromXY(int x, int y, WXYFlags flags = 0)
Parameters
x  (int)
y  (int)
flags  (WXYFlags)
Returns
wnd

Remarks

Unlike API WindowFromPhysicalPoint etc, this function: does not skip disabled controls; always skips transparent control like group box if a smaller sibling is there. All this is not true with flag Raw.

Examples

Find window at 100 200.

var w = wnd.FromXY((100, 200), WXYFlags.NeedWindow);
print.it(w);

Find window or control at 50 from left and 100 from bottom of the work area.

var w = wnd.FromXY(Coord.Normalize(50, ^100, workArea: true));
print.it(w);