I have a very simple dialog application, and am trying to accomplish two tasks with tooltips:
1 ) Get the tooltip to track with the mouse movement,i.e. follow the mouse cursor around, as long as it remains on the same control.
2) Get the tooltip to appear on a disabled control.
I have uploaded my simple project (VS2003, for maximum compatibility :)) to http://www.yousendit.com/download/bVlBWGJDd0lCSWRFQlE9PQ
, please download it and take a look.
FYI, here is the code I am using to create and display the tooltip:
VERIFY ( m_wndTooltip.Create ( this ) );
VERIFY ( m_wndTooltip.AddTool ( GetDlgItem ( IDC_MYCONTROL ), LPSTR_TEXTCALLBACK ) );
VERIFY ( m_wndTooltip.AddTool ( GetDlgItem ( IDC_EDIT1 ), LPSTR_TEXTCALLBACK ) ); // Disabled edit control
xt ( NMHDR* pnmh, LRESULT* pResult )
TOOLTIPTEXT* pttt = ( TOOLTIPTEXT* ) pnmh;
// If the tooltip that this message has been sent for is our tooltip...
if ( pttt->hdr.hwndFrom == m_wndTooltip.m_hWnd )
// Find the string that maps to the window we are displaying the tooltip for ( stored in pttt->hdr.idFrom ).
m_strTooltipText = _T("This is a long tooltip that has come from CEE_Tooltip_QDlg::OnNeedTe
pttt->lpszText = ( LPTSTR ) ( LPCTSTR ) m_strTooltipText;
Can someone please tell me how to achieve these two tasks? I simply cannot find anything on the internet about this.