Link to home
Start Free TrialLog in
Avatar of ShaunWilde
ShaunWilde

asked on

tooltips in a menu

Can anyone give me tips on how to start adding toltips to a menu? We don't have a status bar to put the normal menu help text. It is either that or having a dynamic multiline disabled menu at the bottom of the menu that the info can be displayed in.
Any help on the above will be appreciated.
Avatar of Tommy Hui
Tommy Hui

What you can do is catch the WM_ENTERIDLE message. You can be sure that the user isn't doing anything at that time. Create a timer from that message to delay a bit. When you receive the timer message, show your tooltip window. There may be a problem because if the menu loses focus, the menu will disappear. It is very important not to create a tooltip window in this case. Create the tooltip ahead of time.

In fact, you can have MFC help you quite a bit here. You can reuse the architecture to help you with the message string. Create a frame descandant window with the ID of AFX_IDW_STATUS_BAR, but don't make it visible. This window will receive all of the status messages through WM_SETTEXT. This window can forward all of the messages to the tooltip. So that when you show the tooltip window, it will already have the text in it.
ASKER CERTIFIED SOLUTION
Avatar of gelbert
gelbert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ShaunWilde

ASKER

Hi - is it possible for your to both expand a bit - my application is a dialog only app however the menu I am trying to add tooltips is a context menu that is generated from the tray icon.

As far as getting the tip text I was under the impression I could do LoadString (menuid) as the prompt and the tip share the same resource id.

I have a feeling that gelberts way may have the more self contained (ie a CPopupToolTipMenu) approach that I was looking for.
I could not get this to work - probably my own fault - however I am now going to pursue gelbert's approach.
This approach had merit and seems the best course of action - I have seen similar down in a class library that had windows that looked and acted like a menu (the new office type) and I amended this to do what I wanted.
Hi,
You can use for that tooltips available here: www.tooltips.net, and they can be displayed for menu items as well. I hope you will like it.

Cheers!