?
Solved

Tool Tips for windows in a CToolbar

Posted on 1997-09-09
5
Medium Priority
?
403 Views
Last Modified: 2013-11-20
I have an application that uses SetButtonInfo() to add buttons to the end of a CToolbar.  I then create owner drawn buttons (sub-classed off CButton) as child windows of that toolbar.

The problem is that the tool tips aren't being displayed for these new buttons.  This worked perfectly in versions prior to Visual C++ 5.0.  I simply overrode OnNotify() and looked for the TTN_NEEDTEXT message (in my sub-class of CToolBar).  But now, I don't get this message for my new buttons.

Oh, another thing is that I need to provide the text for the tool tips dynamically, as they depend on user input (they can't come from the resource file).
0
Comment
Question by:Vance Kessler
[X]
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
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1306006
Have you allocated ID numbers to the new buttons?

Are they enabled/active?

0
 

Author Comment

by:Vance Kessler
ID: 1306007
Yes, they all have IDs and are enabled.  As I said earlier they worked perfectly before Visual C++ 5.0 came out.  Now the only thing that doesn't work are the tool tips.
0
 
LVL 8

Accepted Solution

by:
gelbert earned 200 total points
ID: 1306008
In your class derived from CToolBar you would have to overwrite virtual funcion OnToolHitText() which handles setting  tooltips text. And remember you have to allocate memory and copy your text into this memory then assing pointer to this memory to member of tooltip data structure.
0
 

Author Comment

by:Vance Kessler
ID: 1306009
Thanks, That is just what I needed.
0
 
LVL 8

Expert Comment

by:gelbert
ID: 1306010
Hi! If my answer is good enough for you, then I would appriciate if you would accept answer and award points
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 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