ToolTips for Modal Dialog controls
Posted
by Aviad Tobaly
on February 1st, 1999
Changes to header files
private: HICON m_hIcon; CToolTipCtrl m_tool;
Add to implementation file
void CToolTipDlg::OnInitDialog()
{
// Create tooltip object
m_tool.Create(this);
// Add tooltip to the control
m_tool.AddTool(GetDlgItem(Dialog control ID here),tooltip as string);
// TRUE to show tooltips,FALSE to disable tooltips
m_tool.Activate(TRUE);
}
Using ClassWizard, implement the PreTranslateMessage member function and modify it as follows.
void CToolTipDlg::PreTranslateMessage(MSG* pMsg)
{
m_tool.RelayEvent(pMsg);
}
That's it! You now have tooltips on the controls!
Date Last Updated: February 1, 1999

Comments
How to create dynamic ToolTip
Posted by Legacy on 04/22/2003 12:00amOriginally posted by: Haresh Borse
This is really cool.
ReplyI want to create a dynamic tool tip i.e. there should be provision to change the text of tooltip at run time. I will very much thankful if anybody lets me know how to do this.
very good
Posted by Legacy on 02/01/2003 12:00amOriginally posted by: Geo George
it works beautifully
thanx
Replyhow u make BOOL PreTanslateMessage() to void PreTranslateMessage()?
Posted by Legacy on 02/25/2000 12:00amOriginally posted by: Ramaprasad
ReplyRe:How to get tooltips on modless dialogs
Posted by Legacy on 08/13/1999 12:00amOriginally posted by: Justin Hallet
Replytool tip under modeless dialog box
Posted by Legacy on 08/04/1999 12:00amOriginally posted by: Ling Tu
By any chance, is it possible to enable tool tips to
controls (eg. button, image, listbox) under modeless
dialog box?
-Ling Tu
ReplyHow to make it working with a composite control like ComboBox
Posted by Legacy on 04/01/1999 12:00amOriginally posted by: Philippe Minault
If I use this code, it work very well except when the control is made with different other controls like a ComboBox (Edit + Listbox)or a custom control. Somebody has a solution to this problem ?
ReplyWhy this simply code doesn't works in a CFormView
Posted by Legacy on 03/25/1999 12:00amOriginally posted by: Fran�ois DROUHIN
This code works very well in a dialog box (CDialog class), but it doesn't works in a form view (CFormView class).
How can I make it works ?
Fran�ois.
Reply