ITextServices::TxGetCurTargetX method

Gets the target x position, that is, the current horizontal position of the caret.

Syntax


HRESULT TxGetCurTargetX(
  LONG *px
);

Parameters

px

Type: LONG*

The target x location in client coordinates.

Return value

Type: HRESULT

If the x position of the caret is returned, the return value is S_OK.

If the method fails, the return value is the following HRESULT code. For more information on COM error codes, see Error Handling in COM.

Return codeDescription
E_FAIL

There is no selection.

E_INVALIDARG

The input argument is invalid.

 

Remarks

Together with ITextServices::OnTxSetCursor, this method allows you to maintain the horizontal caret position when moving the caret up and down. This capability is useful when moving the caret through forms.

The target caret position is expressed as an x-coordinate on the display because other controls do not necessarily share the same attributes for column position.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Textserv.h

DLL

Msftedit.dll

See also

ITextServices
Reference
OnTxSetCursor
Conceptual
Windowless Rich Edit Controls

 

 

Community Additions

ADD
Show:
© 2014 Microsoft