我试图从第三方软件中提取数据。该窗口具有自定义选项卡控件(不是标准选项卡),其中包含选项卡中的多个SysTreeView32。
该软件有不同的版本,每个版本都有不同的标签集。
Inspect.exe和Spy ++都只显示控件本身,而不显示有关选项卡子项的任何信息。
您知道如何以编程方式按标题选择特定标签吗?
这里是来自Inspect.exe的第三方控件的信息
How found: Mouse move (292,346)
hwnd=0x005203F6 32bit class="Afx:5080000:0:10003:0:0" style=0x56000000 ex=0x0
Name: ""
ControlType: UIA_PaneControlTypeId (0xC371)
LocalizedControlType: "窗格"
BoundingRectangle: {l:98 t:327 r:410 b:1014}
IsEnabled: true
IsOffscreen: false
IsKeyboardFocusable: true
HasKeyboardFocus: false
AccessKey: ""
ProcessId: 36076
RuntimeId: [2A.5203F6]
AutomationId: "221"
FrameworkId: "Win32"
ClassName: "Afx:5080000:0:10003:0:0"
NativeWindowHandle: 0x5203F6
ProviderDescription: "[pid:41692,hwnd:0x5203F6 Main:Nested [pid:36076,hwnd:0x5203F6 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"
IsPassword: false
HelpText: ""
LegacyIAccessible.ChildId: 0
LegacyIAccessible.DefaultAction: ""
LegacyIAccessible.Description: ""
LegacyIAccessible.Help: ""
LegacyIAccessible.KeyboardShortcut: ""
LegacyIAccessible.Name: ""
LegacyIAccessible.Role: 客户端 (0xA)
LegacyIAccessible.State: 可设定焦点 (0x100000)
LegacyIAccessible.Value: ""
IsAnnotationPatternAvailable: false
IsDragPatternAvailable: false
IsDockPatternAvailable: false
IsDropTargetPatternAvailable: false
IsExpandCollapsePatternAvailable: false
IsGridItemPatternAvailable: false
IsGridPatternAvailable: false
IsInvokePatternAvailable: false
IsItemContainerPatternAvailable: false
IsLegacyIAccessiblePatternAvailable: true
IsMultipleViewPatternAvailable: false
IsObjectModelPatternAvailable: false
IsRangeValuePatternAvailable: false
IsScrollItemPatternAvailable: false
IsScrollPatternAvailable: false
IsSelectionItemPatternAvailable: false
IsSelectionPatternAvailable: false
IsSpreadsheetItemPatternAvailable: false
IsSpreadsheetPatternAvailable: false
IsStylesPatternAvailable: false
IsSynchronizedInputPatternAvailable: false
IsTableItemPatternAvailable: false
IsTablePatternAvailable: false
IsTextChildPatternAvailable: false
IsTextEditPatternAvailable: false
IsTextPatternAvailable: false
IsTextPattern2Available: false
IsTogglePatternAvailable: false
IsTransformPatternAvailable: false
IsTransform2PatternAvailable: false
IsValuePatternAvailable: false
IsVirtualizedItemPatternAvailable: false
IsWindowPatternAvailable: false
FirstChild: "" 树
LastChild: "" 树
Next: [null]
Previous: [null]
Other Props: Object has no additional properties
Children: "" 树
Ancestors: "" 窗格
"" 窗格
"" 窗格
"V6" 对话框
"" 窗格
"" 窗格
"" 容器
"V9.32" 窗口
"桌面" 窗格
[ No Parent ]
答案 0 :(得分:0)
如果" AutomationId"是唯一的,我们可以尝试使用" AutomationId"来映射逻辑名称。 &安培;在自动化中使用这些字段。我可能错了,但可能是一个解决方案。