Click to See Complete Forum and Search --> : ToolTip max width doesn't work


WizBang
September 27th, 2005, 04:37 PM
Sending the TTM_SETMAXTIPWIDTH message to set the max width of a tooltip is supposed to cause text which exceeds the specified width to wrap to a new line. I've yet to get this to work. All text continues to push the width of the tip as if the message was never sent. The only way I've gotten text to wrap is to include the carriage return + line feed characters. I've tried sending the message before and after various other messages, including setting the text.

I seem to recall also trying this on both xp and 9x with the same results, but after trying so many things I can't be sure what I've tested where thus far.

Basically, the most important thing is if this really is possible at all. One would think so, since there are plenty of tooltips which appear to be doing this. Second, if possible, then how the heck can it be done?

kirants
September 27th, 2005, 06:32 PM
What does TTM_GETMAXTIPWIDTH return immediately after Set width ?
Also, documentation says text has to have spaces for it to wrap. You are taking care of that right ?

WizBang
September 28th, 2005, 08:42 AM
What does TTM_GETMAXTIPWIDTH return immediately after Set width ?
Also, documentation says text has to have spaces for it to wrap. You are taking care of that right ?

I get the correct value back, no matter what value I use, so that seems to be working. And yes, of course I do have plenty of spaces, so the wrapping should be working.

<NEWS FLASH>
OK, this is weird...NOW IT'S WORKING! I just tried again but with InitCommonControls, and now even without that, the tips are wrapping the text as they should.

Ever notice how you can struggle with something for ages, and only after you post the problem does a solution emerge? Of course, now I'll have to restart in order to verify what I got...

WizBang
September 28th, 2005, 06:30 PM
heh...so now the thing has suddenly and mysteriously decided to always work. I tested an earlier generation of my tooltip code and that still doesn't work, though I don't see what the cause is. So, I'm gonna just use the newer code and move on...maybe I'll poke around with it some time just to satisfy my curiosity.

kirants
September 29th, 2005, 02:51 PM
Maybe something to do with styles not compatible with the installed commmctrl dll ?

WizBang
September 29th, 2005, 03:15 PM
That was my first thought, but I tested both with all the same parameters.

WizBang
September 29th, 2005, 04:30 PM
Oh boy...I found it...

Ever want to kick yourself? Well, I might about now, since the non-working code was using SendMessage instead of SendMessageLong. Don't ask...