IUIAutomationTextEditTextChangedEventHandler::HandleTextEditTextChangedEvent method

Handles an event that is raised when a Microsoft UI Automation provider for a text-edit control reports a programmatic text change.

Syntax

HRESULT HandleTextEditTextChangedEvent(
  IUIAutomationElement                  *sender,
  TextEditChangeType textEditChangeType ,
  SAFEARRAY                             *eventStrings
);

Parameters

sender

Type: IUIAutomationElement*

A pointer to the element that raised the event.

arg2

Type: TextEditChangeType

The type of text-edit change that occurred.

eventStrings

Type: SAFEARRAY*

Event data passed by the event.

Return Value

Type: HRESULT

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

Remarks

This method is implemented by the application to handle events that it has subscribed to by using AddTextEditTextChangedEventHandler.

The event data contains different payloads for each text-edit change type:

  • TextEditChangeType_AutoCorrect: Data is the new corrected string .
  • TextEditChangeType_Composition: Data is the updated string in the composition (only the part that changed).
  • TextEditChangeType_CompositionFinalized: Data is the finalized string of the completed composition (this may be empty if composition was canceled or deleted).

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

Best Practices for Using Safe Arrays

IUIAutomationTextEditTextChangedEventHandler