Travel the world

Climb the mountains

Post Page Advertisement [Top]

Click at control in specific window - C# Programming

Click at control in specific window - C# Programming


In this post, I’ll show you how to click at a certain control in any window. It is a upgrade version of click at certain point which i shown you last post.

similarly, to click at certain control, we have to find its Handle, use Spy or AutoitWIndowInfo.

public static IntPtr FindWindowExFromParent(IntPtr parentHandle, string text, string className);

public static IntPtr FindHandle(IntPtr parentHandle, string className, string text);

FindWindowExFromParent find handle that all parameters matches
FindHandle find handle that just one of parameters have to match

then we have:
var pointToClick = AutoControl.GetGlobalPoint(childhWnd, x, y);
x, y represent coordinate of point needed to click in comparision with window.
x, y get by use Autoit Window Info (coordinate of control compared with window)

pointToClick here return a Point() which represent coodinate of point needed to click in comparision with screen.

Không có nhận xét nào:

Đăng nhận xét

Bottom Ad [Post Page]