ITextStoreAnchor::GetSelection method
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.
Syntax
HRESULT GetSelection( [in] ULONG ulIndex, [in] ULONG ulCount, [out] TS_SELECTION_ANCHOR *pSelection, [out] ULONG *pcFetched );
Parameters
- ulIndex [in]
-
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.
- ulCount [in]
-
Specifies the maximum number of selections to return.
- pSelection [out]
-
Receives the style, start, and end character positions of the selected text. These values are put into the TS_SELECTION_ANCHOR structure.
- pcFetched [out]
-
Receives the number of pSelection structures returned.
Return value
This method can return one of these values.
| Value | Description |
|---|---|
|
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. |
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps | Windows Store apps] |
|
Redistributable |
TSF 1.0 on Windows 2000 Professional |
|
Header |
|
|
IDL |
|
|
DLL |
|
See also
- ITextStoreAnchor
- Miscellaneous Framework Constants
- TF_DEFAULT_SELECTION
- TS_SELECTION_ANCHOR
- ITextStoreAnchor::SetSelection
- Edit Contexts