【发布时间】:2021-09-06 05:15:29
【问题描述】:
我添加了对 UIAutomationTypes 和 UIAutomationClient 的引用 并使用这些导入
Imports System.Windows.Automation
Imports System.Runtime.InteropServices
Imports System.Text
但我得到一个错误: 类型“AutomationElement”未定义 当我使用该代码时
Dim rootElement As AutomationElement = AutomationElement.FromHandle(hwnd)
怎么了?
【问题讨论】:
-
如果是进口问题,这个stackoverflow.com/questions/1469386/… 可能会有所帮助
-
stackoverflow.com/questions/31737003/…。请参考这个解决方案。
-
添加“使用 System.Windows.Automation.AutomationElement”时出现错误,AutomationElement 不是 System.Windows.Automation 的成员