Поделиться через


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;

Параметры

  • 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.

Возвращаемое значение

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

Заметки

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.

Требования

Header: afxcmn.h

См. также

Основные понятия

CToolTipCtrl Class

CToolTipCtrl Members

Hierarchy Chart

CToolTipCtrl::GetToolInfo