Export (0) Print
Expand All

IUIAutomation Interface

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

IUIAutomation Members

AddAutomationEventHandler Registers a method that handles Microsoft UI Automation events.
AddFocusChangedEventHandler Registers a method that handles focus-changed events.
AddPropertyChangedEventHandler Registers a method that handles property-changed events.
AddPropertyChangedEventHandlerNativeArray Registers a method that handles property-changed events.
AddStructureChangedEventHandler Registers a method that handles structure-changed events.
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.
ContentViewCondition Retrieves a predefined IUIAutomationCondition interface that selects content elements.
ContentViewWalker Retrieves an IUIAutomationTreeWalker interface used to discover content elements.
ControlViewCondition Retrieves a predefined IUIAutomationCondition interface that selects control elements.
ControlViewWalker Retrieves an IUIAutomationTreeWalker interface used to discover control elements.
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 an IUIAutomationTreeWalker interface 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 IUIAutomationElement interface for the UI element at the specified point on the desktop.
ElementFromPointBuildCache Retrieves the IUIAutomationElement interface for the UI 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 IUIAutomationElement interface for the UI 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.
MixedAttributeValue Retrieves a static object that is a token representing a text attribute that is mixed.
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.
ProxyFactoryMapping Rretrieves an IUIAutomationProxyFactoryMapping interface that represents the mapping of Window classnames and associated data to individual proxy factories.
RawViewCondition Retrieves an IUIAutomationCondition interface for a predefined condition that selects all UI elements in an unfiltered view.
RawViewWalker Retrieves an IUIAutomationTreeWalker interface used to traverse an unfiltered view of the UI Automation tree.
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.
ReservedMixedAttributeValue Retrieves a static token object representing a text attribute that is a mixed attribute.
ReservedNotSupportedValue Retrieves a static token object representing a property that is not supported.
SafeArrayToRectNativeArray Converts a SAFEARRAY containing rectangle coordinates to an array of type RECT.
VariantToRect Converts a VARIANT containing rectangle coordinate to a RECT.

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));
}

Interface Information

Inherits from IUnknown
Header and IDL files uiautomation.h, uiautomationclient.idl
Minimum operating systems Windows 7

Community Additions

Show:
© 2014 Microsoft