ITextStoreAnchorSink::OnSelectionChange method (textstor.h)

The ITextStoreAnchorSink::OnSelectionChange method is called when the selection within the text stream changes. This method should be called whenever the return value of a potential call to ITextStoreAnchor::GetSelection has changed.

Syntax

HRESULT OnSelectionChange();

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
TS_E_NOLOCK
The manager holds a lock on the document.

Remarks

This method only needs to be called when the application modifies the selection itself, not when a client modifies the selection with ITextStoreAnchor::SetSelection, ITextStoreAnchor::InsertTextAtSelection, or other ITextStoreAnchor methods.

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

Applications should expect reentrant client calls to ITextStoreAnchor::RequestLock from within this method. An application can grant the lock request synchronously, or, because several changes have been cached, it can grant the lock asynchronously.

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

ITextStoreAnchorSink