ToolTip disable timers

I wanna disable all timers in a toolTip.

m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX);  
  m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 100);

I don't need any of those timers, can I disable them ?
Who is Participating?
Meir RivkinConnect With a Mentor Full stack Software EngineerCommented:
even better :+), check this one:

add those members in your CView:
     int m_tipCount;
     CToolTipCtrl m_tooltip;

here's the relevant functions declerations:
     virtual BOOL PreTranslateMessage(MSG* pMsg);
     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
     void GetToolTipString(CPoint pt, CString& tip_str);

void CMFcolorView::GetToolTipString(CPoint pt, CString& tip_str)
    tip_str.Format(_T("x=%d, y=%d"), pt.x, pt.y);

BOOL CMFcolorView::PreTranslateMessage(MSG* pMsg)
    return CWnd::PreTranslateMessage(pMsg);

void CMFcolorView::OnMouseMove(UINT nFlags, CPoint point)
     m_tipCount -= 1;
     if (m_tipCount <= 0)
          CString str;
          GetToolTipString(point, str);
          m_tooltip.UpdateTipText(str, this);
          m_tipCount = 0;
     CView::OnMouseMove(nFlags, point);


int CMFcolorView::OnCreate(LPCREATESTRUCT lpCreateStruct)
     if (CView::OnCreate(lpCreateStruct) == -1)
          return -1;

    //create tool tip object
    m_tooltip.AddTool(this,  (LPCTSTR)_T(""));
    m_tooltip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX);
    m_tooltip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 100);
    m_tooltip.SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, 100);

     m_uTimer = SetTimer(1, 1, 0);
     return 0;

now, move the cursor over the view and see how the tooltip won't let u go anywhere.... :+)

good luck mate
Meir RivkinFull stack Software EngineerCommented:
why do u need to disable them?
win32Author Commented:
Because I want a toolTip all the time !
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Meir RivkinFull stack Software EngineerCommented:
over a control or over a view?
win32Author Commented:
Over a view, I have a toolTip over a window, and it is displayed all the time. Never to disapear, because it holds userdata that is changing all the time !

What my program does:
i have a 3 graphs drawn in a window. When my mouse curser is over a graph it returns data to the user. [Hz, dB] that is displayed in the ToolTip, when the user moves the mouse, new data are displayed, and also if the graph is updated new data will be displayed!!

So I need the ToolTipText over the graph displayed all the time, therefor it's buggin me that the ToolTip will flicker in the display of data evry time a AUTO_POP event is comming up!

That's my problem
Meir RivkinFull stack Software EngineerCommented:
for 50 pts i'll send u a sample code
win32Author Commented:
Sorry for the delayed time..
Why not 75 ? :-)
Meir RivkinFull stack Software EngineerCommented:
btw, u can erase this line: m_uTimer = SetTimer(1, 1, 0);

sorry 4 that...
win32Author Commented:
Thanks man, sorry for my long Re: time

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.