ITextServices::OnTxSetCursor method

Notifies the text services object to set the cursor.

Syntax


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

Parameters

dwDrawAspect [in]

Type: DWORD

Draw aspect can be one of the following values.

ValueMeaning
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 [in]

Type: void*

Information for drawing optimizations.

ptd [in]

Type: DVTARGETDEVICE*

The target device.

hdcDraw [in]

Type: HDC

Rendering device context.

hicTargetDev [in]

Type: HDC

Target information context.

lprcClient [in]

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 [in]

Type: INT

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

y [in]

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 codeDescription
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]

Header

Textserv.h

DLL

Msftedit.dll

See also

ITextServices
Reference
TxDraw
TxGetExtent
TxSetCursor
Conceptual
Windowless Rich Edit Controls
Other Resources
WM_SIZE

 

 

Show: