I have this
in OnInitDialog
// Create the ToolTip control.
m_tooltip.Create(this, TTS_NOPREFIX);
m_tooltip.SetMaxTipWidth(6
m_tooltip.SetDelayTime(TTD
m_tooltip.Activate(TRUE);
m_tooltip.AddTool(GetDlgIt
and in PreTranslateMEssage
{
// Let the ToolTip process this message.
m_tooltip.RelayEvent(pMsg)
}
if(pMsg->message == WM_MOUSEMOVE)
{
m_tooltip.Update(); //different text for different locations on the control
}
and this to fill the tip
message map
ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
function
BOOL CSortDlg::OnToolTipNotify(
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
static TCHAR szMessage[256];
static CPoint point;
static UINT nIndex;
static BOOL bOutside;
if (pTTT->uFlags & TTF_IDISHWND)
{
if(::GetDlgCtrlID((HWND)nI
{
//We are on the list - are we on a line of text?
VERIFY(GetCursorPos(&point
m_lstSort.ScreenToClient(&
nIndex = m_lstSort.ItemFromPoint(po
if(!bOutside)
{
m_lstSort.GetText(nIndex, szMessage);
pTTT->lpszText = szMessage;
return true;
}
}
}
return false;
}
Main Topics
Browse All Topics





by: SteHPosted on 2004-08-19 at 03:04:39ID: 11839618
I just used spy++ to look at tooltip messages and found none. mouse move messages are reported extensivly.