Using MFC, I cannot get the tracking tooltip to display at all,
although I can get normal (i e, not tracking) tooltips to work fine.
Here's a summary of what I'm doing now. The dialog is MyDialog, and the
tool is a static control with ID=IDC_Tool.
In MyDialog.h:
CToolTipCtrl toolTipCtrl;
In MyDialog::OnInitDialog:
toolTipCtrl.Create(this,TTS_ALWAYSTIP | TTF_TRACK | TTF_ABSOLUTE);
CWnd *pWnd=GetDlgItem(id);
TOOLINFO ti;
ti.cbSize = sizeof (TOOLINFO);
ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE;
ti.rect.left = ti.rect.top = ti.rect.bottom = ti.rect.right = 0;
ti.hwnd = pWnd->GetParent ()->GetSafeHwnd ();
ti.uId = (UINT) pWnd->GetSafeHwnd ();
ti.hinst = AfxGetInstanceHandle ();
ti.lpszText = (LPTSTR) pszText;
SendMessage (TTM_ADDTOOL, 0, (LPARAM) &ti);
SendMessage(TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti);
GetDlgItem(IDC_Tool)->EnableTrackingToolTips(TRUE);
toolTipCtrl.Activate(true);
In MyDialog::OnMouseMove(UINT nFlags, CPoint point):
RECT windowRect;
GetDlgItem(IDC_Tool)->GetWindowRect(&windowRect );
if( PtInRect( &windowRect, point ))
{
::SendMessage(GetDlgItem(IDC_Tool)->m_hWnd,
TTM_TRACKPOSITION,
0,
(LPARAM)MAKELPARAM(point.x+30,point.y+30));
}
else CDialog::OnMouseMove(nFlags, point);
IVO
"UI Guy" <sher...@programmer.net> wrote in message news:1108618298....@f14g2000cwb.googlegroups.com...