UiaRaiseTextEditTextChangedEvent function (uiautomationcoreapi.h)

Called by a provider to notify the Microsoft UI Automation core that a text control has programmatically changed text.

Syntax

HRESULT UiaRaiseTextEditTextChangedEvent(
  [in] IRawElementProviderSimple *pProvider,
  [in] TextEditChangeType        textEditChangeType,
  [in] SAFEARRAY                 *pChangedData
);

Parameters

[in] pProvider

Type: IRawElementProviderSimple*

The provider node where the text change occurred.

[in] textEditChangeType

Type: TextEditChangeType

The type of text-edit change that occurred.

[in] pChangedData

Type: SAFEARRAY*

The event data. Should be assignable as a VAR of type VT_BSTR.

Return value

Type: HRESULT

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

Remarks

This is a helper function for providers that implement ITextEditProvider and are raising the pattern's required events. Follow the guidance given in TextEdit Control Pattern that describes when to raise the events and what payload the events should pass to UI Automation.

If there are no clients listening for a particular change type, no event is raised.

The event data should contain different payloads for each change type (per TextEditChangeType):

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

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 R2 [desktop apps | UWP apps]
Target Platform Windows
Header uiautomationcoreapi.h
Library Uiautomationcore.lib
DLL Uiautomationcore.dll

See also

HandleTextEditTextChangedEvent

ITextEditProvider

IUIAutomation3::AddTextEditTextChangedEventHandler

TextEdit Control Pattern