ITextServices::TxQueryHitPoint method

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

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::TxGetNaturalSize 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*

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

x [in]

Type: INT

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

y [in]

Type: INT

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

pHitResult [out]

Type: DWORD*

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

ValueMeaning
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

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
OnTxSetCursor
TxDraw
Conceptual
Windowless Rich Edit Controls

 

 

Community Additions

ADD
Show:
© 2015 Microsoft