Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ToolTip disable timers

Posted on 2001-07-06
9
Medium Priority
?
1,153 Views
Last Modified: 2013-11-20
I wanna disable all timers in a toolTip.

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

I don't need any of those timers, can I disable them ?
0
Comment
Question by:win32
  • 5
  • 4
9 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 6262616
why do u need to disable them?
0
 

Author Comment

by:win32
ID: 6264060
Because I want a toolTip all the time !
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 6264918
over a control or over a view?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:win32
ID: 6265426
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
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 6267982
for 50 pts i'll send u a sample code
0
 

Author Comment

by:win32
ID: 6268318
Sorry for the delayed time..
Why not 75 ? :-)
0
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 300 total points
ID: 6272417
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);


//implementation:
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)
{
    m_tooltip.RelayEvent(pMsg);
    return CWnd::PreTranslateMessage(pMsg);
}


void CMFcolorView::OnMouseMove(UINT nFlags, CPoint point)
{
     //tooltips
     m_tipCount -= 1;
     if (m_tipCount <= 0)
     {
          m_tooltip.Activate(TRUE);
          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;
     
    EnableToolTips(TRUE);

    //create tool tip object
    m_tooltip.Create(this);
    m_tooltip.Activate(TRUE);
    m_tooltip.AddTool(this,  (LPCTSTR)_T(""));
    m_tooltip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX);
    m_tooltip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, 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
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 6272420
btw, u can erase this line: m_uTimer = SetTimer(1, 1, 0);

sorry 4 that...
0
 

Author Comment

by:win32
ID: 6337270
Thanks man, sorry for my long Re: time

CB.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question