IUIAutomation3::AddTextEditTextChangedEventHandler method

Registers a method that handles programmatic text-edit events.

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

Syntax

HRESULT AddTextEditTextChangedEventHandler(
  IUIAutomationElement                         *element,
  TreeScope scope                              ,
  TextEditChangeType textEditChangeType        ,
  IUIAutomationCacheRequest                    *cacheRequest,
  IUIAutomationTextEditTextChangedEventHandler *handler
);

Parameters

element

Type: IUIAutomationElement*

A pointer to the UI Automation element associated with the event handler.

arg2

Type: TreeScope

The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.

arg3

Type: 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

Type: IUIAutomationCacheRequest*

A pointer to a cache request, or NULL if no caching is wanted.

handler

Type: IUIAutomationTextEditTextChangedEventHandler*

A pointer to the object that handles the programmatic text-edit event.

Return Value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

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.

Requirements

   
Minimum supported client Windows 8.1 [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See Also

Caching UI Automation Properties and Control Patterns

Conceptual

IUIAutomation3

Reference

RemoveAllEventHandlers

RemoveTextEditTextChangedEventHandler

Subscribing to UI Automation Events

Understanding Threading Issues