C# 为什么自动化元素属性与Inspect的值不匹配?

C# 为什么自动化元素属性与Inspect的值不匹配?,c#,automation,ui-automation,automationelement,C#,Automation,Ui Automation,Automationelement,获取AutomationElement后,我使用以下方法获取IsContentElement属性: bool isContentElement = (bool)element.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty); Console.WriteLine(isContentElement); 在我的应用程序中输出True 使用Inspect.exe(从安装)时,IsContentElement的值为F

获取
AutomationElement
后,我使用以下方法获取
IsContentElement
属性:

bool isContentElement = (bool)element.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty);
Console.WriteLine(isContentElement);
在我的应用程序中输出
True

使用Inspect.exe(从安装)时,
IsContentElement
的值为
False

我99%确定我的应用程序和Inspect.exe正在查看元素(相同的边界框、相同的控件类型、相同的名称-文件资源管理器Windows 10中垂直滚动条的向下箭头)


似乎也适用于其他属性。为什么它们不匹配?

您正在引用哪些自动化库?我已经看到了较新的COM包装器UIAComWrapper和较旧的UIAutomationClient/UIAutomationTypes之间的差异。另外,我还看到了32位和64位自动化客户端应用程序之间的差异。UIAutomationClient/UIAutomationTypes编译为32位。刚刚使用32位版本的Inspect.exe进行了检查-仍然显示为
False
。您正在引用哪些自动化库?我已经看到了较新的COM包装器UIAComWrapper和较旧的UIAutomationClient/UIAutomationTypes之间的差异。另外,我还看到了32位和64位自动化客户端应用程序之间的差异。UIAutomationClient/UIAutomationTypes编译为32位。刚刚使用32位版本的Inspect.exe进行了检查-仍然显示为
False