【发布时间】:2021-04-19 08:31:58
【问题描述】:
我想找到带有文本的特定按钮(通过文本查找)并按下它。 我试图从 Teleramm 桌面应用程序的 'group'('группа' on screanshot) 元素中获取内部信息,我知道那里有明确的按钮列表,但我无法使用 UIA 和 inspect.exe 找到任何内容。我尝试了原始 automtaion dll 和 nuget UIAComWrapper。 SendMessage(获取文本)和 EnumChildWindows 也没有帮助我,因为 SendMessage 枚举不返回应用程序内的其他句柄。
AutomationElementCollection automation_element_collection = group_element.FindAll(TreeScope.Children, Condition.TrueCondition); //empty collection
AutomationElement automation_element_collection = group_element.FindFirst(TreeScope.Children, Condition.TrueCondition); //returns null
TreeWalker raw_view_walker = TreeWalker.RawViewWalker;
AutomationElement automation_element = raw_view_walker.GetFirstChild(group_element); //returns null
我做错了什么,是否有其他项目可以帮助我解决这个问题?
【问题讨论】:
标签: c# windows ui-automation