Link to home
Start Free TrialLog in
Avatar of jennyhou
jennyhou

asked on

Button's tool tip can't show on WinXP platform.

Hi! I have a question about tooltips. I wrote a program running on WinXP platform. I try to make my program look like "Windows XP Visual Styles", so I use a XML format file to invoke ComCtl32.dll version 6 to make it work. As a result, my program DOES look like Windows XP Visual Styles, but the tooltips on all buttons are gone... I find that it fails when I use "SendMessage(TTM_GETCURRENTTOOL, 0, (LPARAM)&ti))" (Note. ti is TOOLINFO data type). I got a NULL value for ti data structure. Anybody knows what is happening? Please help me out... Thanks in advanced.    


Best Regards,

Jenny

p.s. the tooltips running on Win2000 is working properly.
Avatar of MichaelS
MichaelS

Can you show your code where you fill ti?
ASKER CERTIFIED SOLUTION
Avatar of ShaunWilde
ShaunWilde

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 jennyhou

ASKER

Hello! ShaunWilde,

Thanks for your tips. you remind me to focus on TOOLINFO "SIZE" issue. one of my friends wrote a piece of codes(a class which is derived from CToolTipCtrl) to deal with tooltips for me. That's the codes my friend wrote long time ago... I do not know why he used a user-defined structure just like TOOLINFO, but size is a little bit different. So That's why I got a NULL value for ti data structure except ti.cbSize.(I got incorrect ti.cbSize value) Thanks a lot!


Jenny  
glad to help - a pitfall I usually do myself at least once a month
Than it sounds strange that it worked under other OS.

>p.s. the tooltips running on Win2000 is working properly
> Than it sounds strange that it worked under other OS.

may be maybe not - other OSs may not check the value as they will only fill in the minimum structure however later OS builds may have more to add to the structure so they will check the size value to know whether it is safe to do so - not an uncommon practice - just annoying as it makes you get away with bad code that works on one OS and doesn't on another