.net – How to write a consistent UI Automation for MS? MSAA & UI Automation don’t seem to overlap

netui-automation

Working on a general Automation tool, considering moving from Win32 Message hooks to .net UI Automation, however the feature set of UI Automation doesn't cover all we have in Win32 and still doesn't seem to support all the GUI on Windows.

One such example is Windows Live Messenger.

Windows Live messenger 2009 is still using the older DirectUIHwnd to draw the gui. This means that you can't use windows messages to send to the controls, because the controls don't have their own HWND. It also seems to defeat the new .net UI Automation framework though the documentation seems to make out as if it can be joined in the UI Automation and Microsoft Active Accessibility document.
Looking at MS Accessibility pointed to Active Accessibility 2.0 SDK Tools which showed that MSAA can interact with the contents.

Is there some trick to getting the older MSAA technology that UI Automation seems to be trying to replace to actually work with UI Automation?

I'd rather not have multiple solutions trying to automate the same windows for windows unlike Windows Live Messenger where each of these techniques is valid and will work.

Best Answer

You might want to have a look at version 3 of the UIAutomation API, first released as part of Windows 7, but now available for XP and Vista. I believe it has improved support for interacting with MSAA-enabled targets.

This new API is COM-based, rather than managed; but have a look at UI Automation COM-to .Net Adapter on CodePlex. This takes the COM Api and adapts it to have the same "shape" as the current managed UIAutomation API.

Related Topic