IUIAutomation class com

Exposes methods that enable Microsoft UI Automation client applications to discover, access, and filter UI Automation elements.

To learn more, see learn.microsoft.com/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomation.

Inheritance
Implemented types
Implementers

Constructors

IUIAutomation(VTablePointer ptr)
Creates a new instance of IUIAutomation from a VTablePointer.
IUIAutomation.from(IUnknown interface)
Creates a new instance of IUIAutomation from an existing interface.
factory

Properties

contentViewCondition IUIAutomationCondition?
Retrieves a predefined IUIAutomationCondition interface that selects content elements.
no setter
contentViewWalker IUIAutomationTreeWalker?
Retrieves an IUIAutomationTreeWalker interface used to discover content elements.
no setter
controlViewCondition IUIAutomationCondition?
Retrieves a predefined IUIAutomationCondition interface that selects control elements.
no setter
controlViewWalker IUIAutomationTreeWalker?
Retrieves an IUIAutomationTreeWalker interface used to discover control elements.
no setter
hashCode int
The hash code for this object.
no setterinherited
proxyFactoryMapping IUIAutomationProxyFactoryMapping?
Retrieves an object that represents the mapping of Window classnames and associated data to individual proxy factories.
no setter
ptr VTablePointer
finalinherited
rawViewCondition IUIAutomationCondition?
Retrieves a predefined IUIAutomationCondition interface that selects all UI elements in an unfiltered view.
no setter
rawViewWalker IUIAutomationTreeWalker?
Retrieves a tree walker object used to traverse an unfiltered view of the Microsoft UI Automation tree.
no setter
reservedMixedAttributeValue IUnknown?
Retrieves a static token object representing a text attribute that is a mixed attribute.
no setter
reservedNotSupportedValue IUnknown?
Retrieves a static token object representing a property or text attribute that is not supported.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAutomationEventHandler(UIA_EVENT_ID eventId, IUIAutomationElement? element, TreeScope scope, IUIAutomationCacheRequest? cacheRequest, IUIAutomationEventHandler? handler) → void
Registers a method that handles Microsoft UI Automation events.
addFocusChangedEventHandler(IUIAutomationCacheRequest? cacheRequest, IUIAutomationFocusChangedEventHandler? handler) → void
Registers a method that handles focus-changed events.
addPropertyChangedEventHandler(IUIAutomationElement? element, TreeScope scope, IUIAutomationCacheRequest? cacheRequest, IUIAutomationPropertyChangedEventHandler? handler, Pointer<SAFEARRAY> propertyArray) → void
Registers a method that handles and array of property-changed events.
addPropertyChangedEventHandlerNativeArray(IUIAutomationElement? element, TreeScope scope, IUIAutomationCacheRequest? cacheRequest, IUIAutomationPropertyChangedEventHandler? handler, Pointer<Int32> propertyArray, int propertyCount) → void
Registers a method that handles a native array of property-changed events.
addRef() int
Increments the reference count of this COM object.
inherited
addStructureChangedEventHandler(IUIAutomationElement? element, TreeScope scope, IUIAutomationCacheRequest? cacheRequest, IUIAutomationStructureChangedEventHandler? handler) → void
Registers a method that handles structure-changed events.
checkNotSupported(VARIANT value) bool
Checks a provided VARIANT to see if it contains the Not Supported identifier.
compareElements(IUIAutomationElement? el1, IUIAutomationElement? el2) bool
Compares two UI Automation elements to determine whether they represent the same underlying UI element.
compareRuntimeIds(Pointer<SAFEARRAY> runtimeId1, Pointer<SAFEARRAY> runtimeId2) bool
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(IUIAutomationCondition? condition1, IUIAutomationCondition? condition2) IUIAutomationCondition?
Creates a condition that selects elements that match both of two conditions.
createAndConditionFromArray(Pointer<SAFEARRAY> conditions) IUIAutomationCondition?
Creates a condition that selects elements based on multiple conditions, all of which must be true.
createAndConditionFromNativeArray(Pointer<VTablePointer> conditions, int conditionCount) IUIAutomationCondition?
Creates a condition that selects elements from a native array, based on multiple conditions that must all be true.
createCacheRequest() IUIAutomationCacheRequest?
Creates a cache request.
createFalseCondition() IUIAutomationCondition?
Creates a condition that is always false.
createNotCondition(IUIAutomationCondition? condition) IUIAutomationCondition?
Creates a condition that is the negative of a specified condition.
createOrCondition(IUIAutomationCondition? condition1, IUIAutomationCondition? condition2) IUIAutomationCondition?
Creates a combination of two conditions where a match exists if either of the conditions is true.
createOrConditionFromArray(Pointer<SAFEARRAY> conditions) IUIAutomationCondition?
Creates a combination of two or more conditions where a match exists if any of the conditions is true.
createOrConditionFromNativeArray(Pointer<VTablePointer> conditions, int conditionCount) IUIAutomationCondition?
Creates a combination of two or more conditions where a match exists if any one of the conditions is true.
createPropertyCondition(UIA_PROPERTY_ID propertyId, VARIANT value) IUIAutomationCondition?
Creates a condition that selects elements that have a property with the specified value.
createPropertyConditionEx(UIA_PROPERTY_ID propertyId, VARIANT value, PropertyConditionFlags flags) IUIAutomationCondition?
Creates a condition that selects elements that have a property with the specified value, using optional flags.
createProxyFactoryEntry(IUIAutomationProxyFactory? factory) IUIAutomationProxyFactoryEntry?
Creates a new instance of a proxy factory object.
createTreeWalker(IUIAutomationCondition? pCondition) IUIAutomationTreeWalker?
Retrieves a tree walker object that can be used to traverse the Microsoft UI Automation tree.
createTrueCondition() IUIAutomationCondition?
Retrieves a predefined condition that selects all elements.
elementFromHandle(HWND hwnd) IUIAutomationElement?
Retrieves a UI Automation element for the specified window.
elementFromHandleBuildCache(HWND hwnd, IUIAutomationCacheRequest? cacheRequest) IUIAutomationElement?
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(IAccessible? accessible, int childId) IUIAutomationElement?
Retrieves a UI Automation element for the specified accessible object from a Microsoft Active Accessibility server.
elementFromIAccessibleBuildCache(IAccessible? accessible, int childId, IUIAutomationCacheRequest? cacheRequest) IUIAutomationElement?
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(POINT pt) IUIAutomationElement?
Retrieves the UI Automation element at the specified point on the desktop.
elementFromPointBuildCache(POINT pt, IUIAutomationCacheRequest? cacheRequest) IUIAutomationElement?
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() IUIAutomationElement?
Retrieves the UI Automation element that has the input focus.
getFocusedElementBuildCache(IUIAutomationCacheRequest? cacheRequest) IUIAutomationElement?
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(UIA_PATTERN_ID pattern) BSTR
Retrieves the registered programmatic name of a control pattern.
getPropertyProgrammaticName(UIA_PROPERTY_ID property) BSTR
Retrieves the registered programmatic name of a property.
getRootElement() IUIAutomationElement?
Retrieves the UI Automation element that represents the desktop.
getRootElementBuildCache(IUIAutomationCacheRequest? cacheRequest) IUIAutomationElement?
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(Pointer<Int32> array, int arrayCount) Pointer<SAFEARRAY>
Converts an array of integers to a SAFEARRAY.
intSafeArrayToNativeArray(Pointer<SAFEARRAY> intArray, Pointer<Pointer<Int32>> array, Pointer<Int32> arrayCount) → void
Converts a SAFEARRAY of integers to an array.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pollForPotentialSupportedPatterns(IUIAutomationElement? pElement, Pointer<Pointer<SAFEARRAY>> patternIds, Pointer<Pointer<SAFEARRAY>> patternNames) → void
Retrieves the control patterns that might be supported on a UI Automation element.
pollForPotentialSupportedProperties(IUIAutomationElement? pElement, Pointer<Pointer<SAFEARRAY>> propertyIds, Pointer<Pointer<SAFEARRAY>> propertyNames) → void
Retrieves the properties that might be supported on a UI Automation element.
queryInterface<T extends IUnknown>() → T
Queries this COM object for a specific interface defined by the type parameter T.
inherited
rectToVariant(RECT rc) Pointer<VARIANT>
Creates a VARIANT that contains the coordinates of a rectangle.
release() int
Decrements the reference count of this COM object.
inherited
removeAllEventHandlers() → void
Removes all registered Microsoft UI Automation event handlers.
removeAutomationEventHandler(UIA_EVENT_ID eventId, IUIAutomationElement? element, IUIAutomationEventHandler? handler) → void
Removes the specified UI Automation event handler.
removeFocusChangedEventHandler(IUIAutomationFocusChangedEventHandler? handler) → void
Removes a focus-changed event handler.
removePropertyChangedEventHandler(IUIAutomationElement? element, IUIAutomationPropertyChangedEventHandler? handler) → void
Removes a property-changed event handler.
removeStructureChangedEventHandler(IUIAutomationElement? element, IUIAutomationStructureChangedEventHandler? handler) → void
Removes a structure-changed event handler.
safeArrayToRectNativeArray(Pointer<SAFEARRAY> rects, Pointer<Pointer<RECT>> rectArray, Pointer<Int32> rectArrayCount) → void
Converts a SAFEARRAY containing rectangle coordinates to an array of type RECT.
toString() String
A string representation of this object.
override
variantToRect(VARIANT var$) Pointer<RECT>
Converts a VARIANT containing rectangle coordinates to a RECT.

Operators

operator ==(Object other) bool
The equality operator.
inherited