displaying tooltips on custom dockable CToolBarCtrl

displaying tooltips on custom dockable CToolBarCtrl

Post by Paul Harpe » Wed, 29 Jan 1997 04:00:00



I am having trouble gettings tooltips to display on a custom dockable
CToolBarCtrl (created at runtime). Have created a tooltip control,
attached
it to the controlbar, have called tooltip.activate, called addtool for
each
button on the control bar

     CRect butrect;
     tbc.GetItemRect(buttonindex, &butrect);   // get rectangle
                                               // of button

     CToolTipCtrl* pttc = tbc.GetToolTips();

     pttc->AddTool( this, (const char *)pchBut->mButtonHelp,
        &butrect, idOfLastButtonAdded);

but still no joy.
Do I give the owner of the tooltip as the CToolBarCtrl, or the main
Frame window?
Do I still need to respond to tooltip notify messages, and if so where
(the main frame window or the CToolBarCtrl?
Do I need to relay mouse messages from somewhere to somewhere else?

I find the documentation a bit confusing vis a vis CToolBar,
CToolBarCtrl and the whole tooltip saga.

Using Spy++, i notice a wm_notify message to my main frame window
whenever I move the mouse over a new toolbar button, but my

BOOL CMainFrame::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT *
pResult )

never seems to get called.

My message map entry is

   ON_NOTIFY_EX_RANGE( TTN_NEEDTEXT, TOOLBARMENUBASE, TOOLBARMENUBASE +
TOOLBARMENURANGE, OnToolTipNotify )

Any help much appreciated.

Regards  
------Choice Computing-----CAD & Graphics Software -----------
 |    Paul Harper              

 
 
 

1. DEBUG:Tooltips= YES REL:Tooltips?NO!

VC++ 4.2b, MFC, Something odd has happened: When I compile
a Windows 95 EXE under _DEBUG configuration tooltips
are present on the toolbar. When I compile under
_RELEASE configuration they no longer work. Any ideas
anyone?

Please reply publicly *and* by email if possible

Thanks!


Buy the book! "AutoCAD Programming in C/C++"  ISBN 0471963364
INFO:     http://www.buildingweb.com/progacad      
ORDER:    https://www.wiley.com/compbooks/catalog/96336-4.htm

2. Changing addresses

3. ToolTips - Wrong Displays

4. Command Post

5. Wrong tooltips displayed... help.

6. Uninstall NT4

7. Tooltip display problems

8. Java and IE6

9. any way to speed up tooltip display???

10. Tooltips 'displaying behind taskbar' bug still in SP1

11. Speeding up the Tooltip display time

12. MFC: How to display tooltips for Toolbar?

13. Tooltips not displayed