Solved

ToolTip disable timers

Posted on 2001-07-06
9
1,110 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 …
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

20 Experts available now in Live!

Get 1:1 Help Now