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
Solved

ToolTip disable timers

Posted on 2001-07-06
9
1,122 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: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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 114
countEvens challenge 2 112
tripleUp challenge 7 86
unix example issues 18 99
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

829 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