ITextStoreAnchorSink::OnTextChange method (textstor.h)

Called when text in the text stream changes.

Syntax

HRESULT OnTextChange(
  [in] DWORD   dwFlags,
  [in] IAnchor *paStart,
  [in] IAnchor *paEnd
);

Parameters

[in] dwFlags

Contains a set of flags that specify additional information about the text change. This can be one or more of the following values.

Value Meaning
0
The text has changed.
TS_TC_CORRECTION
The text is a transform (correction) of existing content, and any special text markup information (metadata) is retained, such as .wav file data or a language identifier. This flag is used for applications that need to preserve data associated with the original text.

[in] paStart

Pointer to an anchor located at the start of the changed text.

[in] paEnd

Pointer to an anchor located at the end of the changed text.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
E_FAIL
The method was unable to create cloned anchors to contain the change.
E_INVALIDARG
paStart or paEnd is invalid.
E_OUTOFMEMORY
A memory allocation failure occurred.
TS_E_NOLOCK
The TSF manager holds a lock on the document. This typically indicates that the method was called from within another ITextStoreAnchor method, such as ITextStoreAnchor::SetText.

Remarks

This method is called only when the application modifies its own text, not when a client modifies text with one of the ITextStoreAnchor methods, such as ITextStoreAnchor::SetText or ITextStoreAnchor::InsertTextAtSelection.

When calling this method, the application must be able to grant a document lock.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header textstor.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also

Document Locks

ITextStoreAnchor

ITextStoreAnchor::InsertTextAtSelection

ITextStoreAnchor::SetText

ITextStoreAnchorSink

Miscellaneous Text Store Constants