ITextServices::OnTxSetCursor method (textserv.h)

Notifies the text services object to set the cursor.

Syntax

HRESULT OnTxSetCursor(
  DWORD          dwDrawAspect,
  LONG           lindex,
  void           *pvAspect,
  DVTARGETDEVICE *ptd,
  HDC            hdcDraw,
  HDC            hicTargetDev,
  LPCRECT        lprcClient,
  INT            x,
  INT            y
);

Parameters

dwDrawAspect

Type: DWORD

Draw aspect can be one of the following values.

Value Meaning
DVASPECT_CONTENT
Renders a screen image of the text content to the hdcDraw device context. The hicTargetDev and ptd parameters give information on the target device context if any (usually a printer).
DVASPECT_DOCPRINT
Renders the object to the hdcDraw device context as though it were printed to a printer. Thus, the text services object can optimize for the printer (for example, not painting the background color, if white). Also, certain screen-specific elements (such as the selection) should not be rendered.

ITextServices::OnTxSetCursor should render the lprcClient rectangle, starting at the current scrolling position.

lindex

Type: LONG

Not supported.

pvAspect

Type: void*

Information for drawing optimizations.

ptd

Type: DVTARGETDEVICE*

The target device.

hdcDraw

Type: HDC

Rendering device context.

hicTargetDev

Type: HDC

Target information context.

lprcClient

Type: LPCRECT

The control's client rectangle. The coordinates of the rectangle are in client coordinates of the containing window. NULL is a legal value.

x

Type: INT

x position of cursor, in the client coordinates of the containing window.

y

Type: INT

y position of cursor, in the client coordinates of the containing window.

Return value

Type: HRESULT

If the method succeeds, 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 code Description
E_INVALIDARG
One or more illegal parameters.

Remarks

The text services object may remeasure as a result of this call to determine the correct cursor. The correct cursor is set through TxSetCursor.

The lprcClient parameter is the client rectangle of the view of the control over which the mouse cursor is positioned. The lprcClient parameter is in device coordinates of the containing window in the same way the WM_SIZE message is. This may not be the view that was rendered last. Furthermore, if the control is in-place active, this may not be the current active view . As a consequence, the text services object should check this rectangle against its current cache's value and determine whether recalculating the lines is necessary or not. The zoom factor should be included in this computation. For a discussion of the zoom factor, see TxGetExtent.

This method should be called only for screen views of the control. Therefore the device context (DC) is not passed in, but should be assumed to be a screen DC.

For more information, see the Remarks in ITextServices::TxDraw.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header textserv.h
DLL Msftedit.dll

See also

Conceptual

ITextServices

Other Resources

Reference

TxDraw

TxGetExtent

TxSetCursor

WM_SIZE

Windowless Rich Edit Controls