这是一个在对话框的矩形区域显示ToolTip的例子,其实
也可以自己响应WM_MOUSEMOVE消息来做啊。void InitToolTip();
void SetToolTip(UINT uToolID, const CString& strText, const CRect& rect); 
CToolTipCtrl m_tooltip;
                        
                        
And here's the code for the CPP file:
                        
                        
BOOL CTestToolTipsDlg::OnInitDialog() 
{
CDialog::OnInitDialog();
CRect rect;
GetClientRect(rect);
// Split the dialog box into 3 equal horizontal portions
SetToolTip(1, "Top", CRect(0, 0, rect.Width(), rect.Height() / 3));
SetToolTip(2, "Middle", CRect(0, rect.Height() / 3, rect.Width(), rect.Height() * 2 / 3));
SetToolTip(3, "Bottom", CRect(0, rect.Height() * 2 / 3, rect.Width(), rect.Height()));
return TRUE;  // return TRUE unless you set the focus to a control
               // EXCEPTION: OCX Property Pages should return FALSE

               
               
BOOL CTestToolTipsDlg::PreTranslateMessage(MSG* pMsg) 
{
InitToolTip();
m_tooltip.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
} void CTestToolTipsDlg::InitToolTip()
{
// Create ToolTip control (if needed)
if (m_tooltip.m_hWnd == NULL)
m_tooltip.Create(this);}  void CTestToolTipsDlg::SetToolTip(UINT uToolID, const CString& strText, const CRect& rect)
{
// Initialize ToolTip
InitToolTip(); 
// If there is no tooltip defined then add it
if (m_tooltip.GetToolCount() < (int)uToolID)
m_tooltip.AddTool(this, strText, rect, uToolID);
else // Set text for tooltip
m_tooltip.UpdateTipText(strText, this, uToolID); 

m_tooltip.Activate(TRUE);
}