aardio 文档

aardio 范例: UIAComWrapper

System.Windows.Automation.3 调用开源组件 UIAComWrapper

//UIAComWrapper
//UIA 探测工具: file://~/tools/Spy/inspect.aardio
import mouse;

/*
System.Windows.Automation.3 用于替代 import System.Windows.Automation 并扩展部分接口。
用法与 System.Windows.Automation 相同。

System.Windows.Automation.3 调用开源组件 UIAComWrapper:
https://github.com/TestStack/UIAComWrapper/
更多用法请参考 UIAComWrapper 项目主页。

请不要在同一进程中同时导入 System.Windows.Automation 与 System.Windows.Automation.3。
如果先导入了 System.Windows.Automation.3 则导入 System.Windows.Automation 时忽略不作任何操作。
*/
import System.Windows.Automation.3;

mouse.wait()

//支持 Win8 以及之后的系统,Win7 退化为 System.Windows.Automation
var rect = System.Windows.Automation.GetCaret();
if(rect) mouse.moveTo(rect);

/*
获取光标建议用 winex.caret.get() ,
该函数已包含 System.Windows.Automation.GetCaret()
*/
Markdown 格式