ITextServices::OnTxSetCursor method (textserv.h)
Notifies the text services object to set the cursor.
Syntax
HRESULT OnTxSetCursor(
[in] DWORD dwDrawAspect,
LONG lindex,
[in] void *pvAspect,
[in] DVTARGETDEVICE *ptd,
[in] HDC hdcDraw,
[in] HDC hicTargetDev,
[in] LPCRECT lprcClient,
[in] INT x,
[in] INT y
);
Parameters
[in] dwDrawAspect
Type: DWORD
Draw aspect can be one of the following values.
lindex
Type: LONG
Not supported.
[in] pvAspect
Type: void*
Information for drawing optimizations.
[in] ptd
Type: DVTARGETDEVICE*
The target device.
[in] hdcDraw
Type: HDC
Rendering device context.
[in] hicTargetDev
Type: HDC
Target information context.
[in] 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.
[in] x
Type: INT
x position of cursor, in the client coordinates of the containing window.
[in] 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 |
---|---|
|
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
Requirement | Value |
---|---|
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
Other Resources
Reference