ITextStoreAnchor::GetSelection method (textstor.h)
The ITextStoreAnchor::GetSelection method returns the offset of a text selection in a text stream. This method supports multiple text selections. The caller must have a read-only lock on the document before calling this method.
HRESULT GetSelection( [in] ULONG ulIndex, [in] ULONG ulCount, [out] TS_SELECTION_ANCHOR *pSelection, [out] ULONG *pcFetched );
Specifies the text selections that start the process. If the TF_DEFAULT_SELECTION constant is specified for this parameter, the input selection starts the process, and only a single selection (the one appropriate for input operations) will be returned.
Specifies the maximum number of selections to return.
Receives the style, start, and end character positions of the selected text. These values are put into the TS_SELECTION_ANCHOR structure.
Receives the number of pSelection structures returned.
This method can return one of these values.
||The method was successful.|
||The method was unable to load the start or end anchor into the TS_SELECTION_ANCHOR structure.|
||The method was unable to allocate memory for the selection.|
||The caller does not have a read-only lock on the document.|
||The document has no selection.|
|Minimum supported client||Windows 2000 Professional [desktop apps | UWP apps]|
|Minimum supported server||Windows 2000 Server [desktop apps | UWP apps]|
|Redistributable||TSF 1.0 on Windows 2000 Professional|