Platforms to show: All Mac Windows Linux Cross-Platform

Back to UIAutomationMBS class.

UIAutomationMBS.AddActiveTextPositionChangedEventHandler(element as UIAutomationElementMBS, TreeScope as Integer, cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationActiveTextPositionChangedEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles when the active text position changes.

element: the UI Automation element associated with the event handler.
scope: The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.
cacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the active text position changed event.

Active text position is indicated by a navigation event within or between read-only text elements (such as web browsers, Portable Document Format (PDF) documents, or EPUB documents) using bookmarks (or fragment identifiers to refer to a location within a resource). Examples include

  • Navigating to a bookmark within the same web page
  • Navigating to a bookmark on a different web page
  • Activating a link to a different location within the same PDF
  • Activating a link to a different location within the same EPUB
Use this event handler to sync the visual location of the bookmark/target with the focus location in a read-only text element, which can diverge when using bookmarks or fragment identifiers.

For example, when a same page anchor (<a href="#C4">Jump to Chapter 4</a> ...<h1><a name="C4">Chapter 4</a></h1>) is invoked, the visual location is updated, but the UI Automation client remains at the original location. This results in actions such as text reading or move next item commands starting from the original location, not the new location.

Similarly, activating a new page URI (with a fragment identifier: (<a href="www.blah.com#C4">Jump to Chapter 4</a>) loads the new page and jumps to the specified bookmark, but leaves the UI Automation clients at the top of the page.

For editable text elements, such as Edit and Rich Editcontrols, you can listen for a SelectionChanged event.

It is possible for an event to be delivered to an event handler after the handler has been unsubscribed, if the event is received simultaneously with the request to unsubscribe the event. The best practice is to follow the Component Object Model (COM) standard and avoid destroying the event handler object until its reference count has reached zero. Destroying an event handler immediately after unsubscribing for events may result in an access violation if an event is delivered late.

For Windows 10, version 1809 or later.

UIAutomationMBS.AddAutomationEventHandler(eventId as Integer, element as UIAutomationElementMBS, TreeScope as Integer, cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles Microsoft UI Automation events.

eventId: The identifier of the event that the method handles. For a list of event IDs, see Event Identifiers.
element: the UI Automation element to associate with the event handler.
scope: The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.
cacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the event.

A UI Automation client should not use multiple threads to add or remove event handlers. Unexpected behavior can result if one event handler is being added or removed while another is being added or removed in the same client process.

UIAutomationMBS.AddChangesEventHandler(element as UIAutomationElementMBS, TreeScope as Integer, changeTypes() as Integer, cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationChangesEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles change events.

element: the UI Automation element associated with the event handler.
scope: The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.
changeTypes: a list of integers that indicate the change types the event represents.
CacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the changes event.

A Microsoft UI Automation client should not use multiple threads to add or remove event handlers. Unexpected behavior can result if one event handler is being a

For Windows 10, version 1607 or later.

UIAutomationMBS.AddEventHandlerGroup(element as UIAutomationElementMBS, handlerGroup as UIAutomationEventHandlerGroupMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a collection of event handler methods specified with the CreateEventHandlerGroup.

element: the UI Automation element associated with the event handler group.
handlerGroup: A collection of UI Automation event listeners.

It is possible for an event to be delivered to an event handler after the handler has been unsubscribed, if the event is received simultaneously with the request to unsubscribe the event. The best practice is to follow the Component Object Model (COM) standard and avoid destroying the event handler object until its reference count has reached zero. Destroying an event handler immediately after unsubscribing for events may result in an access violation if an event is delivered late.

For Windows 10, version 1809 or later.

UIAutomationMBS.AddFocusChangedEventHandler(cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationFocusChangedEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles focus-changed events.

cacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the event.

Focus-changed events are system-wide; you cannot set a narrower scope.
A UI Automation client should not use multiple threads to add or remove event handlers. Unexpected behavior can result if one event handler is being added or removed while another is being added or removed in the same client process.

Some examples using this method:

UIAutomationMBS.AddNotificationEventHandler(element as UIAutomationElementMBS, TreeScope as Integer, cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationNotificationEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles notification events.

element: the UI Automation element associated with the event handler.
scope: The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.
cacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the notification event.

For Windows 10, version 1709 or later.

UIAutomationMBS.AddPropertyChangedEventHandler(element as UIAutomationElementMBS, TreeScope as Integer, propertyArray() as Integer, cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationPropertyChangedEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles and array of property-changed events.

element: the UI Automation element associated with the event handler.
scope: The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and children.
cacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the event.
propertyArray: the UI Automation properties of interest.

The UI item specified by element might not support the properties specified by the propertyArray parameter.

A UI Automation client should not use multiple threads to add or remove event handlers. Unexpected behavior can result if one event handler is being added or removed while another is being added or removed in the same client process.

UIAutomationMBS.AddStructureChangedEventHandler(element as UIAutomationElementMBS, TreeScope as Integer, cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationStructureChangedEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles structure-changed events.

element: the UI Automation element associated with the event handler.
scope: The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.
cacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the structure-changed event.

A UI Automation client should not use multiple threads to add or remove event handlers. Unexpected behavior can result if one event handler is being added or removed while another is being added or removed in the same client process.

UIAutomationMBS.AddTextEditTextChangedEventHandler(element as UIAutomationElementMBS, TreeScope as Integer, textEditChangeType as Integer, cacheRequest as UIAutomationCacheRequestMBS, handler as UIAutomationNotificationEventHandlerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a method that handles programmatic text-edit events.

element: the UI Automation element associated with the event handler.
scope: The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.
textEditChangeType: The specific change type to listen for. Clients register for each text-edit change type separately, so that the UI Automation system can check for registered listeners at run-time and avoid raising events for particular text-edit changes when there are no listeners.
cacheRequest: a cache request, or nil if no caching is wanted.
handler: the object that handles the programmatic text-edit event.

A UI Automation client should not use multiple threads to add or remove event handlers. Unexpected behavior can result if one event handler is being added or removed while another is being added or removed in the same client process.

For Windows 8.1 or later.

UIAutomationMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The destructor.

UIAutomationMBS.FocusedElementBuildCache(CacheRequest as UIAutomationCacheRequestMBS) as UIAutomationElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
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.

cacheRequest: the cache request, which specifies the properties and control patterns to store in the cache.

UIAutomationMBS.PatternProgrammaticName(patternId as Integer) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the registered programmatic name of a control pattern.

patternId: The identifier of the control pattern.

The programmatic name is intended for debugging and diagnostic purposes only. The string is not localized.

This property should not be used in string comparisons. To determine whether two control patterns are the same, compare the control pattern identifiers directly.

UIAutomationMBS.PropertyProgrammaticName(propertyId as Integer) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the registered programmatic name of a property.

proepertyId: The property identifier.

The programmatic name is intended for debugging and diagnostic purposes only. The string is not localized.

This property should not be used in string comparisons. To determine whether two properties are the same, compare the property identifiers directly.

The items on this page are in the following plugins: MBS WinFrameworks Plugin.


The biggest plugin in space...