I need for get UIelements using "UIautomation" technology from another programms in windows OS. Some programms has "chrome-like" browsers for content rendering. The methods are get element (like c# AutomationElement.FromPoint / FindAll) return browser element with ClassName "Chrome_RenderWidgetHostHWND" and Name like a "Chrome Legacy Window". But i need the content elements in that browser.

I found out that, programm "Accessibility Insights" can do it!

  1. Run application, "Microsoft Teams", for example
  2. Run "Accessibility Insights"
  3. Move mouse on "Microsoft Teams", we get "Chrome Legacy Window"
  4. After any mouse click (left/right) on target programm ("Microsoft Teams") provoke rebuild UI tree
  5. Then UIautomation technology can get all inner UI elements in browser.

"Accessibility Insights" source code is https://github.com/microsoft/accessibility-insights-windows I studied it very carefully, but not found code, that provide rebuilding (or, initializing?) inner UI elements.

Any one can help me? What i should to do for win my task - get inner UI elements in chrome-like browsers at another programm on windows OS?

If you've read to the end, thank you

1

There are 1 best solutions below

0
On BEST ANSWER

Accessibility Insights for Windows doesn't interact directly with the UI Automation system. It builds on Axe.Windows (Source code), which queries and exposes the UI Automation properties. In the case you're describing, Axe.Windows is walking the UI Automation tree in response to a UIA_AutomationFocusChangedEventId message from the UI Automation framework. That notification gets handled by the onFocusChangedEventForSelectingElement method of FocusTracker.cs. Hopefully that will be enough to get you started.

--Dave Tryon (Accessibility Insights team)