Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

ValueDescription
S_OK

The method was successful.

E_FAIL

The method was unable to load the start or end anchor into the TS_SELECTION_ANCHOR structure.

E_OUTOFMEMORY

The method was unable to allocate memory for the selection.

TS_E_NOLOCK

The caller does not have a read-only lock on the document.

TS_E_NOSELECTION

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

Textstor.h

IDL

Textstor.idl

DLL

Msctf.dll

See also

ITextStoreAnchor
Miscellaneous Framework Constants
TF_DEFAULT_SELECTION
TS_SELECTION_ANCHOR
ITextStoreAnchor::SetSelection
Edit Contexts

 

 

Show:
© 2018 Microsoft