使用Windows自动化查找和调用没有祖先的button

使用Windows自动化查找和调用没有祖先的button,第1张

概述使用Windows自动化查找调用没有祖先的button

我们正尝试在Lync界面中自动点击以下button。 问题是我们无法可靠地点击它。 有时候它有效。 其他时间没有。 我们正在努力完成的是打开Lync选项窗口。

以下是问题的一些部分:

我们使用System.windows.automation命名空间进行UI自动化。

通常我们调用automationElement.FindFirst来获取UI元素

这对button不起作用,因为button的菜单没有任何祖先

所以,我们使用TreeWalker来遍历automomationElement.RootElement所有后代

使用TreeWalker ,我们有时find一个匹配,但奇怪,不可预测的,我们有时不会

使用Inspect.exe我们可以看到button的“上下文”菜单没有任何祖先

我们如何可靠地find并点击button?

在Qt Creator中使用C ++ 11

C上的系统编程

从记事本进程内存中读取文本

如何从可执行文件find源文件名?

如何告诉gcc不使用内置函数

从Inspect.exe

How found: Selected from tree... name: "" ControlType: UIA_MenuItemControlTypeID (0xC35B) LocalizedControlType: "menu item" ProcessID: 0 IsControlElement: true IsContentElement: true ProvIDerDescription: "[pID:3084,hwnd:0x0 Annotation:Microsoft: Annotation Proxy (unmanaged:UIautomationCore.dll); Main(parent link):Microsoft: MSAA Proxy (unmanaged:UIautomationCore.dll)]" IsPeripheral: [Not supported] liveSettingProperty: [Not supported] FlowsFrom: [Not supported] OptimizeforVisualContent: [Not supported] Annotation.AnnotationAuthor: [Not supported] Annotation.AnnotationTypeID: [Not supported] Annotation.Author: [Not supported] Annotation.DateTime: [Not supported] Annotation.Target: [Not supported] Drag.DropEffect: [Not supported] Drag.DropEffects: [Not supported] Drag.GrabbedItems: [Not supported] Drag.IsGrabbed: [Not supported] DropTarget.DropTargetEffect: [Not supported] DropTarget.DropTargetEffects: [Not supported] LegacyIAccessible.ChildID: 3 LegacyIAccessible.name: "" ObjectModel.UnderlyingObjectModel: [Error: calling getter for this property: hr=0x80070057 - The parameter is incorrect.] SpreadsheetItem.AnnotationObjects: [Not supported] SpreadsheetItem.AnnotationTypes: [Not supported] SpreadsheetItem.Formula: [Not supported] Style.ExtendedPropertIEs: [Not supported] Style.Fillcolor: [Not supported] Style.FillPatterncolor: [Not supported] Style.FillPatternStyle: [Not supported] Style.Shape: [Not supported] Style.StyleID: [Not supported] Style.Stylename: [Not supported] transform2.CanZoom: [Not supported] transform2.ZoomLevel: [Not supported] transform2.ZoomMinimum: [Not supported] transform2.ZoomMaximum: [Not supported] IsAnnotationPatternAvailable: [Not supported] IsDragPatternAvailable: [Not supported] IsDockPatternAvailable: false IsDropTargetPatternAvailable: [Not supported] IsExpandCollapsePatternAvailable: false IsGrIDItemPatternAvailable: false IsGrIDPatternAvailable: false IsInvokePatternAvailable: false IsItemContainerPatternAvailable: false IsLegacyIAccessiblePatternAvailable: true IsMultipleVIEwPatternAvailable: false IsObjectModelPatternAvailable: [Not supported] IsRangeValuePatternAvailable: false IsScrollitemPatternAvailable: false IsScrollPatternAvailable: false IsSelectionItemPatternAvailable: false IsSelectionPatternAvailable: false IsspreadsheetItemPatternAvailable: [Not supported] IsspreadsheetPatternAvailable: [Not supported] IsstylesPatternAvailable: [Not supported] IsSynchronizedinputPatternAvailable: false IstableItemPatternAvailable: false IstablePatternAvailable: false IsTextChildPatternAvailable: [Not supported] IsTextEditPatternAvailable: [Not supported] IsTextPatternAvailable: false IsTextPattern2Available: [Not supported] IsTogglePatternAvailable: false IstransformPatternAvailable: false Istransform2PatternAvailable: [Not supported] IsValuePatternAvailable: false IsVirtualizedItemPatternAvailable: false IsWindowPatternAvailable: false FirstChild: [null] LastChild: [null] Next: [null] PrevIoUs: [null] Other Props: Object has no additional propertIEs Children: [Error: calling getter for this property: hr=0x80004005 - UnspecifIEd error] Ancestors: "Context" menu "Context" window [ No Parent ]

取消WIN32线程池中的预定工作/ IO /定时器项目

WM_SETFOCUS,得到失去焦点的应用程序

编译依赖于ActiveX的C#WinForm,而不注册它

subprocess的进程父ID与父进程的PID不同

在UNIX shell脚本中按照多个字段的唯一值sorting

如何通过UIA打开下拉菜单,然后使用SendKeys发送Alt-D(“%d”)?

总结

以上是内存溢出为你收集整理的使用Windows自动化查找和调用没有祖先的button全部内容,希望文章能够帮你解决使用Windows自动化查找和调用没有祖先的button所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1158132.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存