Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IUIAutomation interface

Exposes methods that enable Microsoft UI Automation client applications to discover, access, and filter UI Automation elements. UI Automation exposes every element of the UI Automation as an object represented by the IUIAutomation interface. The members of this interface are not specific to a particular element.

When to implement

UI Automation client applications do not implement IUIAutomation.

Members

The IUIAutomation interface inherits from the IUnknown interface. IUIAutomation also has these types of members:

Methods

The IUIAutomation interface has these methods.

MethodDescription
AddAutomationEventHandler

Registers a method that handles UI Automation events.

Note  Before implementing an event handler, you should be familiar with the threading issues described in Understanding Threading Issues.

AddFocusChangedEventHandler

Registers a method that handles focus-changed events.

Note  Before implementing an event handler, you should be familiar with the threading issues described in Understanding Threading Issues.

AddPropertyChangedEventHandler

Registers a method that handles property-changed events.

Note  Before implementing an event handler, you should be familiar with the threading issues described in Understanding Threading Issues.

AddPropertyChangedEventHandlerNativeArray

Registers a method that handles property-changed events.

Note  Before implementing an event handler, you should be familiar with the threading issues described in Understanding Threading Issues.

AddStructureChangedEventHandler

Registers a method that handles structure-changed events.

Note  Before implementing an event handler, you should be familiar with the threading issues described in Understanding Threading Issues.

CheckNotSupported

Checks a provided VARIANT to see if it contains the Not Supported identifier.

CompareElements

Compares two UI Automation elements to determine whether they represent the same underlying UI element.

CompareRuntimeIds

Compares two integer arrays containing run-time identifiers (IDs) to determine whether their content is the same and they belong to the same UI element.

CreateAndCondition

Creates a condition that selects elements that match both of two conditions.

CreateAndConditionFromArray

Creates a condition that selects elements based on multiple conditions, all of which must be true.

CreateAndConditionFromNativeArray

Creates a condition that selects elements based on multiple conditions, all of which must be true.

CreateCacheRequest

Creates a cache request.

CreateFalseCondition

Creates a condition that is always false.

CreateNotCondition

Creates a condition that is the negative of a specified condition.

CreateOrCondition

Creates a combination of two conditions where a match exists if either of the conditions is true.

CreateOrConditionFromArray

Creates a combination of two or more conditions where a match exists if any of the conditions is true.

CreateOrConditionFromNativeArray

Creates a combination of two or more conditions where a match exists if any one of the conditions is true.

CreatePropertyCondition

Creates a condition that selects elements that have a property with the specified value.

CreatePropertyConditionEx

Creates a condition that selects elements that have a property with the specified value, using optional flags.

CreateProxyFactoryEntry

Creates a new instance of a proxy factory object.

CreateTreeWalker

Retrieves a tree walker object that can be used to traverse the UI Automation tree.

CreateTrueCondition

Retrieves a predefined condition that selects all elements.

ElementFromHandle

Retrieves a UI Automation element for the specified window.

ElementFromHandleBuildCache

Retrieves a UI Automation element for the specified window, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

ElementFromIAccessible

Retrieves a UI Automation element for the specified accessible object from a Microsoft Active Accessibility server.

ElementFromIAccessibleBuildCache

Retrieves a UI Automation element for the specified accessible object from a Microsoft Active Accessibility server, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

ElementFromPoint

Retrieves the UI Automation element at the specified point on the desktop.

ElementFromPointBuildCache

Retrieves the UI Automation element at the specified point on the desktop, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

GetFocusedElement

Retrieves the UI Automation element that has the input focus.

GetFocusedElementBuildCache

Retrieves the UI Automation element that has the input focus, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

GetPatternProgrammaticName

Retrieves the registered programmatic name of a control pattern.

GetPropertyProgrammaticName

Retrieves the registered programmatic name of a property.

GetRootElement

Retrieves the UI Automation element that represents the desktop.

GetRootElementBuildCache

Retrieves the UI Automation element that represents the desktop, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

IntNativeArrayToSafeArray

Converts an array of integers to a SAFEARRAY.

IntSafeArrayToNativeArray

Converts a SAFEARRAY of integers to an array.

PollForPotentialSupportedPatterns

Retrieves the control patterns that might be supported on a UI Automation element.

PollForPotentialSupportedProperties

Retrieves the properties that might be supported on a UI Automation element.

RectToVariant

Creates a VARIANT that contains the coordinates of a rectangle.

RemoveAllEventHandlers

Removes all registered UI Automation event handlers.

RemoveAutomationEventHandler

Removes the specified UI Automation event handler.

RemoveFocusChangedEventHandler

Removes a focus-changed event handler.

RemovePropertyChangedEventHandler

Removes a property-changed event handler.

RemoveStructureChangedEventHandler

Removes a structure-changed event handler.

SafeArrayToRectNativeArray

Converts a SAFEARRAY containing rectangle coordinates to an array of type RECT.

VariantToRect

Converts a VARIANT containing rectangle coordinates to a RECT.

 

Properties

The IUIAutomation interface has these properties.

PropertyAccess typeDescription

ContentViewCondition

Read-only

Retrieves a predefined IUIAutomationCondition interface that selects content elements.

ContentViewWalker

Read-only

Retrieves an IUIAutomationTreeWalker interface used to discover content elements.

ControlViewCondition

Read-only

Retrieves a predefined IUIAutomationCondition interface that selects control elements.

ControlViewWalker

Read-only

Retrieves an IUIAutomationTreeWalker interface used to discover control elements.

ProxyFactoryMapping

Read-only

Retrieves an object that represents the mapping of Window classnames and associated data to individual proxy factories.

RawViewCondition

Read-only

Retrieves a predefined IUIAutomationCondition interface that selects all UI elements in an unfiltered view.

RawViewWalker

Read-only

Retrieves a tree walker object used to traverse an unfiltered view of the UI Automation tree.

ReservedMixedAttributeValue

Read-only

Retrieves a static token object representing a text attribute that is a mixed attribute.

ReservedNotSupportedValue

Read-only

Retrieves a static token object representing a property or text attribute that is not supported.

 

Remarks

Every UI Automation client application must obtain this interface to a CUIAutomation object in order to gain access to the functionality of UI Automation.

The following example function creates a CUIAutomation object and obtains the IUIAutomation interface.


IUIAutomation *g_pAutomation;

BOOL InitializeUIAutomation()
{
    CoInitialize(NULL);
    HRESULT hr = CoCreateInstance(__uuidof(CUIAutomation), NULL, CLSCTX_INPROC_SERVER, 
        __uuidof(IUIAutomation), (void**)&g_pAutomation);
    return (SUCCEEDED(hr));
}

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista, Windows XP with SP3 and Platform Update for Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008, Windows Server 2003 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]

Header

UIAutomationClient.h (include UIAutomation.h)

IDL

UIAutomationClient.idl

DLL

UIAutomationCore.dll

IID

IID_IUIAutomation is defined as 30cbe57d-d9d0-452a-ab13-7ac5ac4825ee

See also

UI Automation Element Interfaces for Clients

 

 

Community Additions

Show:
© 2014 Microsoft