Given an Automation Element how do i simulate a single left click on it

后端 未结 3 1296
遇见更好的自我
遇见更好的自我 2020-12-16 14:30
AutomationElement child = walker.GetFirstChild(el);

using windows automation How do i simulator a left single click on Child ?

3条回答
  •  执念已碎
    2020-12-16 15:23

    if the control has a "ClickablePoint" you can use this code

                System.Windows.Point p = theButton.GetClickablePoint();
                AutoItX3Lib.AutoItX3Class au3;
                au3 = new AutoItX3Lib.AutoItX3Class();
                au3.AutoItSetOption("MouseCoordMode", 0);
                au3.MouseClick("LEFT", (int)p.X, (int)p.Y, 1, -1);
    

    where AutoItX3Lib is the C# API for AutoIt

提交回复
热议问题