1

Having fetched an AutomationElement I get the IsContentElement property using:

bool isContentElement = (bool)element.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty);
Console.WriteLine(isContentElement);

Outputs True in my application.

Using Inspect.exe (installed from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) the value for IsContentElement is False.

I am 99% certain my application and Inspect.exe are looking at the element (same bounding box, same control type, same name - the down arrow of the vertical scroll bar in File Explorer Windows 10).

Seems to apply to other properties as well. Why do they not match up?

Woodgnome
  • 2,281
  • 5
  • 28
  • 52
  • Which automation libraries are you referencing? I have seen differences between the newer COM wrapper UIAComWrapper and the older UIAutomationClient/UIAutomationTypes. Alternatively I have also seen differences between what 32-bit and 64-bit automation client applications see. – Mike Zboray Mar 13 '17 at 17:58
  • 1
    UIAutomationClient/UIAutomationTypes compiled to 32 bit. Just checked with the 32 bit version of Inspect.exe - still shows up as `False`. – Woodgnome Mar 14 '17 at 08:40
  • @MikeZboray 4 years later and I finally understood your comment. I was using the `UIAutomationClient` assembly (which is deprecated https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-textrange_gettext) - using the `UIAutomationClient` COM library works. Post an answer and I'll accept. – Woodgnome Nov 08 '21 at 12:58

0 Answers0