ITfRange::Collapse method

The ITfRange::Collapse method clears the range of text by moving its start anchor and end anchor to the same position.

Syntax


HRESULT Collapse(
  [in]  TfEditCookie ec,
  [in]  TfAnchor aPos
);

Parameters

ec [in]

Edit cookie obtained from ITfDocumentMgr::CreateContext or ITfEditSession::DoEditSession.

aPos [in]

TfAnchor enumeration that describes how to collapse the range.

ValueMeaning
TF_ANCHOR_START

The end anchor is moved to the location of the start anchor.

TF_ANCHOR_END

The start anchor is moved to the location of the end anchor.

 

Return value

This method can return one of these values.

ValueDescription
S_OK

The method was successful.

E_FAIL

The object does not support the interface, or a new range cannot be created.

E_INVALIDARG

aPos is invalid.

TF_E_NOLOCK

The cookie in ec is invalid, or the caller does not have a read-only lock.

 

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

ITfRange
Text Stores
ITfDocumentMgr::CreateContext
ITfEditSession::DoEditSession
TfAnchor

 

 

Community Additions

ADD
Show:
© 2014 Microsoft