Python-UIAutomation-for-Windows
Python-UIAutomation-for-Windows copied to clipboard
使用inspect.exe可以看到控件父子关系, 但是用UIA无法正常Walk
2019-12-20 11:38:04.577 automation.py[75] main -> Starts, Current Cursor Position: (188, 244) ControlType: PaneControl ClassName: #32769 AutomationId: Rect: (0,0,1707,960)[1707x960] Name: 桌面 1 Handle: 0x10010(65552) Depth: 0 SupportedPattern: LegacyIAccessiblePattern ControlType: WindowControl ClassName: WindowsForms10.Window.8.app.0.14b2c3b_r9_ad1 AutomationId: Rect: (0,0,1024,768)[1024x768] Name: 收银系统 Handle: 0xA018C4(10492100) Depth: 1 SupportedPattern: LegacyIAccessiblePattern WindowPattern 2019-12-20 11:38:04.705 automation.py[110] main -> Ends
这个收银系统, 使用uiautomation.py 默认参数,没法打印子控件。 但是在inspect.exe里可以看到整个控件的tree
另外,这个Window使用uia库的各种search properties 都无法找到。 只能通过cursor或者foreground找到
https://s2.ax1x.com/2019/12/20/QOuj3D.png 这是用inspect.exe看到的tree
请问怎样才能正确walk这个控件的tree呢
这个应该是 .Net 的 toolkit,用 UIA 的方案行不通,可以试试 MSAA 相关的库。