19

I really want to know, how Inspect.exe gets it's UI-Elements, because it gets by far more elements than UISpy (Both available in Microsoft Windows SDK 7).

1) I think UISpy gets it's elements with UIAutomation library, right? (Tried it with UIAutomation and got exactly the same elements, that UISpy displayed).

2) Which library does Inspect.exe use? Because it shows some UI-Elements of a Application with MacromediaFlashPlayerActiveX for example, which I need to get in my own UI-Automation-Application, hope somebody knows something about it.

EDIT: Inspect also have a "UI Automation" Mode, does it also use UIAutomation library? The strange thing about it is, that in Inspect it also shows many more elements than UISpy.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Not really a duplicate, but [here is a related older question of mine that might give some info](http://stackoverflow.com/questions/9282275/automationelement-shows-up-using-inspect-exe-but-does-show-not-up-when-using-uia). – Scott Chamberlain Nov 08 '16 at 21:32
  • 2
    UISpy is [declared obsolete](https://msdn.microsoft.com/en-us/library/ms727247(v=vs.110).aspx), Inpect is the recommended replacement. You are seeing friction within Microsoft between very different groups in very different divisions, it is a very large company. UI Automation is a Windows group responsibility, they don't like .NET, owned by Servers and Tools. Sadly the WinRT debacle did not tone them down much. If you target .NET then UISpy is the most accurate reflection of what you can do with the System.Windows.Automation namespace. – Hans Passant Nov 08 '16 at 23:44
  • 1
    UISpy is obsolete now, it's recommended to use Inspect.exe – Ripon Al Wasim Oct 30 '19 at 08:16
  • 3
    On [a page dated 02018-05-31](https://learn.microsoft.com/en-us/windows/win32/winauto/inspect-objects), Microsoft states "Inspect is a legacy tool. We recommend using [Accessibility Insights](https://accessibilityinsights.io/) instead." (Disclaimer: I'm not an expert this area, I was just googling for answers and ended up here (and then at the MS page)) – unbob Feb 16 '20 at 18:14

1 Answers1

31

UISpy is a .NET program that uses .NET's UIAutomation assemblies. These assemblies were introduced with .NET Framework 2.

Inspect is a native program that uses UIAutomationCore.dll (available in the System directory). UIAutomationCore is a native COM Windows DLL that implements the UI Automation Windows API. This API has been upgraded with Windows, for example here is a link to Windows 8+ improvements: What's New in UI Automation?

.NET's UIAutomation assemblies use UIAutomationCore.dll internally. However, Microsoft never upgraded them to new features of the native UI Automation API. A lot of properties (for example all ARIA properties which are very useful), patterns, events, etc, are therefore missing if you use the original .NET's UIAutomation.

But, there is still hope in the .NET world, because there is a project here: https://uiacomwrapper.codeplex.com/ that is a source-compatible newer version of .NET UIAutomation (It's been in fact written by a Microsoft guy, I don't understand why they don't publish this in a more official way and upgrade .NET's UIAutomation...). It defines most new Windows 8 properties, patterns and interfaces.

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
  • There is another, better, tool, [Visual UI Automation Verify (Visual UIA Verify)](https://learn.microsoft.com/en-us/windows/win32/winauto/visual-ui-automation-verify) – Кое Кто Aug 06 '20 at 10:45
  • Nice hint for the **tool _Visual UIA Verify_** and a useful article. But it's not easy to find the tool itself. You can **download** it here: https://archive.codeplex.com/?p=uiautomationverify ... extract the ZIP, go to sourceCode, extract _sourceCode.zip_, open the solution, compile it, run it, have fun. ... For me the compilation worked without any problems. I don't understand why there is no official download or binary files. – Beauty Oct 01 '20 at 10:44