ITextServices::TxQueryHitPoint method (textserv.h)

Tests whether a specified point is within the rectangle of the text services object.

Syntax

HRESULT TxQueryHitPoint(
  [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,
  [out] DWORD          *pHitResult
);

Parameters

[in] 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::TxGetNaturalSize should render the lprcClient rectangle, starting at the current scrolling position.

lindex

Type: LONG

Not supported.

[in] pvAspect

Type: void*

Information for drawing optimizations.

[in] ptd

Type: DVTARGETDEVICE*

Information on 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, in client (device) coordinates of the view in which the hit testing is done.

[in] x

Type: INT

x-coordinate to check, in client coordinates, of the view in which hit testing is done.

[in] y

Type: INT

y-coordinate to check, in client coordinates, of the view in which hit testing is done.

[out] pHitResult

Type: DWORD*

The result of the hit test. It can be any of the following TXTHITRESULT enumeration values.

Value Meaning
TXTHITRESULT_CLOSE
The point is in the client rectangle and close to a nontransparent area.
TXTHITRESULT_HIT
The point is in the client rectangle and either over text or the background is not transparent.
TXTHITRESULT_NOHIT
The point is outside of the client rectangle.
TXTHITRESULT_TRANSPARENT
The point is in the client rectangle and either not over text or the background was transparent.

Return value

Type: HRESULT

The return value is an HRESULT code.

Remarks

This method allows the host to implement transparent hit testing on text.

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

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

ITextServices

OnTxSetCursor

Reference

TxDraw

Windowless Rich Edit Controls