CToolTipCtrl::HitTest

测试点确定它是否在特定工具的边框内,并且,如果是这样,检索有关工具的信息。

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

参数

  • pWnd
    指向包含工具的窗口。

  • pt
    对包含该点坐标的 CPoint 对象的指针将测试。

  • lpToolInfo
    对包含有关工具的信息的 TOOLINFO 结构的指针。

返回值

非零,则命中测试信息指定的点工具中的边框内;否则为0。

备注

如果此函数返回非零值,结构指向由 lpToolInfo 有关填充矩形点之间工具的信息。

TTHITTESTINFO 结构定义为:

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
    指定工具的句柄。

  • pt
    一个,如果此点在工具的边框,指定点的坐标。

  • ti
    有关工具的信息。 有关 TOOLINFO framework的更多信息,请参见 CToolTipCtrl::GetToolInfo

要求

Header: afxcmn.h

请参见

参考

CToolTipCtrl Class

层次结构图

CToolTipCtrl::GetToolInfo