Solved

Modifying tooltips

Posted on 2004-09-19
7
325 Views
Last Modified: 2013-11-20
How can I modify the tooltips the MFC displays in the SDI/MDI application? I want them to be dynamically-adjustable, for instance, for the tooltip which corresponds to Undo I want to show something like "Undo: 5 more available".
0
Comment
Question by:Lescha
[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
  • 3
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 80 total points
ID: 12095138
0
 
LVL 2

Expert Comment

by:bcsonka
ID: 12096287
Hi,

Try using the CToolTipCtrl::UpdateTipText method.  Here's an example:

================================================================================

CString tooltipMsg = "My updated tooltip text";
tooltip->UpdateTipText(tooltipMsg, cwndPtr);

================================================================================

tooltip ==> pointer to an instance of CToolTipCtrl
cwndPtr ==> pointer to the control to contain the updated tooltip text (CWnd*)

I hope that helps.
0
 
LVL 1

Author Comment

by:Lescha
ID: 12149638
Alex, could you please explain to me why there are 4 possibilities in the code? I thought Unicode would work only with one of *A or *W functions/types (which one, by the way?), and non-unicode with the other.

bcsonka, would that things could be that simple. I don't think there is a way of actually obtaining those pointers. If you know one please tell.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Expert Comment

by:AlexFM
ID: 12150457
There are two messages: TTN_NEEDTEXTA and TTN_NEEDTEXTW. Program may be in two configurations: ANSI and Unicode. This code is written by safety way, so that it is ready to handle TTN_NEEDTEXTW in ANSI configuration. I am not sure that this can actually happen, but safety is always good.
0
 
LVL 1

Author Comment

by:Lescha
ID: 12153369
Okay... but don't I actually control whether or not my program is Unicode? Why bother with this #ifndef stuff?
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 12153610
This means, you always work in ANSI configuration created by VC++ by default. But you can add UNICODE configuration to your project and work in it (this is a best choice for WinNT and later). The code from this sample is OK both for UNICODE and ANSI configurations. You can read more information here:
http://www.codeproject.com/cpp/unicode.asp
 
0
 
LVL 1

Author Comment

by:Lescha
ID: 12153621
Okay, thanks.
The answer most probably will go to Alex, but I'll wait for bcsonka for a day or two.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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
sum13 challenge 24 149
isEverywhere  challenge 19 91
Execute multiple curl cmds with sleep and send output to file 10 121
matchUp  challenge 9 134
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: 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…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

751 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