Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Is there a way to add tool-tip when hovering over a control-bar's title? Collapse All
Subject Author Date
Offer Har Dec 22, 2008 - 9:53 PM



Technical Support Dec 26, 2008 - 2:47 AM

All the OnToolHitTest() virtual methods in all the Prof-UIS classes are similar to the CWnd::OnToolHitTest() virtual method:

The hit testing result is item identifier or -1 if there is no tooltip should appear. If tooltip should appear, then you should specify tooltip text allocated in the dynamic memory using the _tcsdup() API or the LPSTR_TEXTCALLBACK pseudo string pointer which will make the tooltip control sending the TTN_NEEDTEXT message. The last case is enough obsolete is not supported by Prof-UIS themed tooltips. The returned item identifier can be any positive value if tooltip is not displayed by toolbar button. Of course you should specify rectangle for displaying tooltip in the TOOLINFO data structure:

The _tcsdup() API simply allocates memory buffer using good classic malloc() and copies specified string into it:

Do not worry about the allocated memory. If the request for tooltip text is came from MFC, then MFC will de-allocate this memory using the free() API automatically. If it’s came from Prof-UIS, then the themed tooltip control will copy the tooltip text and free the specified memory even before the tooltip window appears on the screen.

Offer Har Dec 27, 2008 - 1:21 PM

Dear Support,

I was able to show the tool-tip - I had to put something in pTI->rect - does it matter what I put there?

Another problem - if the control-bar does not have focus, the tip is not displayed - the OnToolHitTest is called, but the tool-tip is not displayed - is it on purpose or is it a bug? I do need to see the tooltip even when it’s not the focus window.

Also - the tool-tip are the dull yellow one - can I change it to be the more modern one?



Offer Har Dec 27, 2008 - 8:27 AM

Dear Support,

I still have problems makeing it work:

  1. What is the ID I should return from the function, any number is good?

  2. How do I know that the point is over the title and not the close button for esample?

  3. How do I compute the rectangle for the tooltip, and why should I even do it?

I tried to do this:




CMyControlBar::OnToolHitTest(CPoint point,TOOLINFO * pTI






char buffer[] = "This is the buffer text";char *newstring;




newstring = _strdup( buffer );pTI->lpszText = newstring;return 1;


But saw nothing...

Technical Support Dec 29, 2008 - 8:21 AM

We created a small application:

The identifier value is required as hit-testing result. The -1 identifier means tooltip should not be displayed. The rectangle for tooltip tracking is the required parameter of tooltip tracking algorithm. Tooltip window hides itself automatically when the mouse pointer leaves the rectangle.

Offer Har Dec 31, 2008 - 5:07 AM

Dear Support,

Thank-you very much for the demo, there are a couple of things that are not clear:

1) When the control-bar if floating, the tip is not displayed in your ap[plication - why is that?

2) The location of the tip is always at the same place on the X axir of the control-bar, and not the location of the cursor- why is that?

3) I see you use CExtCTA to make the tips cool - how to use this class? I could not find any mention of it in the help

Thanks & Happy new year,


Technical Support Dec 24, 2008 - 7:59 AM

Yes. You should implement the CExtControlBar::OnToolHitTest() virtual method. By default this method allows all the caption buttons to display their tooltips. The CExtBarNcAreaButton::DoDefaultReflectForToolHitTest() method fills the hit testing information data structure with tooltip data. Your method should do the same for entire caption or its part which should have tooltip.

Offer Har Dec 24, 2008 - 1:36 PM

Dear Support,

It’s not very clear to me what we’re supposed to do... Tried to override OnToolHitTest, but no idea what to do there. Also, this function is not mentioned in the help.