MSAA finds UI Automation controls not
I am working on automating a windows application. I am using white structure teststack. I got into a problem. This program has a "Window" object that I cannot see inside. White does not show any controls within it. Inspect.exe does not show any controls inside it or when running in UI Automation mode. If I switch Inspect to MSAA it sees the controls inside are just fine. Is there anyway for me to use MSAA from C # to get a handle to these controls?
source to share
-
If you can define the MSAA functions you need, you can use P / Invoke to call them from C #. Here's an example article on this from MSAA:
http://www.codeproject.com/Articles/38906/UI-Automation-Using-Microsoft-Active-Accessibility
-
Additionally, pinvoke.net can be used to identify IAccessible (MSAA) features:
http://www.pinvoke.net/search.aspx?search=IAccessible&namespace= [All]
Here's another SO answer along these lines:
-
Finally, as an alternative to P / Invoke, you can also use Tlbimp.exe to create a wrapper assembly for oleacc.dll and access MSAA functions through it. I'm not sure if this works with MSAA, but it's worth a try.
As an example, here is a C # hello world example I wrote that shows how to use the COM UI Automation from C # using an assembly generated with Tlbimp.exe:
As mentioned in the comments in this file, starting with the Windows SDK 7.1 the build with Tlbimp.exe looked like this:
"%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\bin\tlbimp.exe" %windir%\system32\UIAutomationCore.dll /out:interop.UIAutomationCore.dll
source to share