CToolTipCtrl::HitTest

Tests a point to determine whether it is within the bounding rectangle of the given tool and, if so, retrieve information about the tool.

BOOL HitTest( 
   CWnd* pWnd, 
   CPoint pt, 
   LPTOOLINFO lpToolInfo  
) const;

Parameters

  • pWnd
    Pointer to the window that contains the tool.

  • pt
    Pointer to a CPoint object containing the coordinates of the point to be tested.

  • lpToolInfo
    Pointer to TOOLINFO structure that contains information about the tool.

Return Value

Nonzero if the point specified by the hit-test information is within the tool's bounding rectangle; otherwise 0.

Remarks

If this function returns a nonzero value, the structure pointed to by lpToolInfo is filled with information on the tool within whose rectangle the point lies.

The TTHITTESTINFO structure is defined as follows:

typedef struct _TT_HITTESTINFO { // tthti

HWND hwnd; // handle of tool or window with tool

POINT pt; // client coordinates of point to test

TOOLINFO ti; // receives information about the tool

} TTHITTESTINFO, FAR * LPHITTESTINFO;

  • hwnd
    Specifies the tool's handle.

  • pt
    Specifies the coordinates of a point if the point is in the tool's bounding rectangle.

  • ti
    Information about the tool. For more information about the TOOLINFO structure, see CToolTipCtrl::GetToolInfo.

Requirements

Header: afxcmn.h

See Also

Reference

CToolTipCtrl Class

Hierarchy Chart

CToolTipCtrl::GetToolInfo