Solved

ToolTip disable timers

Posted on 2001-07-06
9
1,129 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 42

Expert Comment

by:sedgwick
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:sedgwick
ID: 6264918
over a control or over a view?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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:sedgwick
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:
sedgwick earned 75 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:sedgwick
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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