ITfRange::ShiftEnd method (msctf.h)

Moves the end anchor of the range.

Syntax

HRESULT ShiftEnd(
  TfEditCookie      ec,
  LONG              cchReq,
  LONG              *pcch,
  const TF_HALTCOND *pHalt
);

Parameters

ec

Contains an edit cookie that identifies the edit context. This is obtained from ITfDocumentMgr::CreateContext or ITfEditSession::DoEditSession.

cchReq

Contains the number of characters that the end anchor is shifted. A negative value causes the anchor to move backward and a positive value causes the anchor to move forward.

pcch

Pointer to a LONG value that receives the number of characters the anchor shifted.

pHalt

Pointer to a TF_HALTCOND structure that contains conditions on the shift. This parameter is optional and can be NULL.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
E_FAIL
An unspecified error occurred.
E_INVALIDARG
One or more parameters are invalid.
TF_E_NOLOCK
The edit context identified by ec does not have a read-only lock.

Remarks

The start and end positions of a range are called anchors.

This method cannot move an anchor beyond a region boundary. If the shift reaches a region boundary, the number of characters actually shifted will be less than requested. ITfRange::ShiftEndRegion is used to shift the anchor to an adjacent region.

If the shift operation causes the range end anchor to move past the start anchor, the start anchor is moved to the same location as the end anchor.

ITfRange::ShiftEnd can be a lengthy operation. For better performance, use ITfRange::ShiftEndToRange when possible.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header msctf.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also

ITfDocumentMgr::CreateContext

ITfEditSession::DoEditSession

ITfRange

ITfRange::ShiftEndRegion

ITfRange::ShiftStart

TF_HALTCOND