Solved

ToolTip

Posted on 2001-06-19
5
520 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
Prevent this page from creating additional dialogs. 3 718
only14 challenge 19 84
canBalance challenge 34 105
My project did see openJDK that I installed. What could be the problem 7 161
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.

749 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