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.

ITfContext::SetSelection method

Syntax


HRESULT SetSelection(
  [in]       TfEditCookie ec,
  [in]       ULONG        ulCount,
  [inconst TF_SELECTION *pSelection
);

Parameters

ec [in]

Contains an edit cookie that identifies the edit session. This is the value passed to ITfEditSession::DoEditSession.

ulCount [in]

Specifies the number of selections in the pSelection array.

pSelection [in]

An array of TF_SELECTION structures that contain the information for each selection.

Return value

This method can return one of these values.

ValueDescription
S_OK

The method was successful.

TF_E_NOSELECTION

The document has no selection.

TF_E_NOLOCK

The cookie in ec is invalid.

 

Remarks

A selection is a span of highlighted text, or an insertion point if the span is empty, identifying the user focus area within a document. Some documents are capable of having multiple selections. There can only be one zero-length selection in pSelection as it represents the position of the document caret.

If an application must adjust the text covered by a selection, it should wait until the caller releases the lock. However, applications can adjust any of the style members of the TF_SELECTION structures while still returning S_OK.

The caller can set the fInterimChar flag only if one selection is set. In this case, the selection should span exactly one character and the ase member of the TF_SELECTION structure is set to TFAE_NONE.

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

Msctf.h

IDL

Msctf.idl

DLL

Msctf.dll

See also

ITfContext
ITfEditSession::DoEditSession
TF_SELECTION

 

 

Show:
© 2017 Microsoft