Solved

ToolTip

Posted on 2001-06-19
5
477 Views
Last Modified: 2013-11-20
Hi I wanna cal a ToolTip from my OnMouseMove.. When the mouse is over a pos(x,y) in a HWnd, then I want a ToolTip to pop up..

I don't want to attach the ToolTip Control to a ID.. Just want a function that cals a tooltip.

How is that done ?
0
Comment
Question by:win32
  • 2
  • 2
5 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 6205865
post your e-mail and i'll send it to u
0
 

Author Comment

by:win32
ID: 6205898
email:
cb_priv@hotmail.com
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 6205931
post your e-mail and i'll send it to u
0
 

Author Comment

by:win32
ID: 6205996
It works the first time, but the ToolTip, only shows 1 time.. If you move the curser, then a new tooltip should pop up at the new curser position..

Why does, the tip not pop up at the new possition of the curser, and how is it done ?

CB.
0
 
LVL 12

Accepted Solution

by:
migel earned 50 total points
ID: 6206127
Hi!
for example
void CMyWnd::OnMouseMove(UINT nFlags, CPoint point)
{
    //tooltips
static int  tipCount -= 1;
    if (tipCount<=0)
    {
     tooltip.Activate(TRUE)
     {
         CString str;
         //GetToolTipString(point, str);
         tooltip.UpdateTipText(str, this);
     };
     tipCount = 4;
    };
}

int CMyWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CWnd::OnCreate(lpCreateStruct) == -1)
         return -1;
     
    CRect r;

    EnableToolTips(TRUE);
    //create tool tip object
    tooltip.Create(this);
    tooltip.Activate(TRUE);
    tooltip.AddTool(this,  (LPCTSTR)_T(""));
    tooltip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX);
    tooltip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, SHRT_MAX);
    tooltip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 100);
    tooltip.SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, 100);

    return 0;
}

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

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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

758 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