Solved

ToolTip disable timers

Posted on 2001-07-06
9
1,117 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating Labels and Frequency list style reports in SAS code 9 92
either24  challenge 19 90
matchUp  challenge 9 94
x-bar in Google Sheets 2 26
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now