Solved

Modifying tooltips

Posted on 2004-09-19
7
317 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

911 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

26 Experts available now in Live!

Get 1:1 Help Now