Link to home
Start Free TrialLog in
Avatar of BWarmuskerken
BWarmuskerken

asked on

Change Tooltip text using the contols handle no MFC

Is there a way to change the Tooltip text when the only info I have is the handle of the control?  
Avatar of jkr
jkr
Flag of Germany image

If you have the control's handle, 'SetWindowText()' should work, e.g.

SetWindowText(hToolTip,"New Text");
Avatar of BWarmuskerken
BWarmuskerken

ASKER

Oops, let me clarify.  I have the handle to the button/textbox/etc.., not the tooltip window itself.
If you have the control's handle, you could 'EnumChildWindows()' until you find one with the 'TOOLTIPS_CLASS' class name. BTW, a good starting point for samples is http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tooltip/tooltip.asp ("About ToolTip Controls ")
Okay, getting closer.  

Using Spy++ I can narrow down which tooltip window I need to change the text in.  Using SetWindowText on will change the caption in Spy++, but the tooltip text stays the same.  Any ideas where to go from here.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

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