Click here to Skip to main content
15,888,008 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Experts
Hi Want to set the text for tooltips window
I write the following code for reading text from tooltips :
hWndToolTip = ::FindWindow("tooltips_class32",NULL);
iToolTipLen = ::SendMessage(hWndToolTip,WM_GETTEXTLENGTH,0,0);
strToolTipText = new TCHAR[iToolTipLen]; // Allocate the buffer
::SendMessage(hWndToolTip,WM_GETTEXT,(WPARAM)iToolTipLen+1,(LPARAM)strToolTipText ); // Get the needed text in strToolTipText

Now I am trying to set the text in same tooltips window by using following aproach
char * strMsg = "This user defined tooltip";
SendMessageW(hWndToolTip, WM_SETTEXT, 0, (LPARAM)strMsg);

but am not able to change tooltips text at runtime
Can u please help me to explain what is going wrong with this code n what extra I need to do???

Thanks in adv.
Posted
Updated 29-Aug-11 3:44am
v2
Comments
Albert Holguin 29-Aug-11 11:00am    
Not exactly sure if you mean what I think when you say tooltips... but your approach may not be ideal... http://msdn.microsoft.com/en-us/library/11tydcwt%28v=vs.80%29.aspx#_core_activating_tool_tips[^]
R. S. Verma 30-Aug-11 2:55am    
Hi Albert
Thanks for suggestion but I want to explain my objective for ur clerification, actually I want to access tooltips from any where like from start button, from desktop's icons or folder view.
This is done by my aproch..
Now i need to set that tooltip text again according to my requirement what i want.
thats why I am using this kind of aproach , and asking for solution.
thanks for giving suggestion...
and welcome further suggestion from you guyes...

1 solution

SendMessageW??? => SendMessage (without W)

and the buffer in the first snippet needs to be longer
 
Share this answer
 
Comments
R. S. Verma 29-Aug-11 7:07am    
Hi Karstenk
Thanks For Replying
but its not working as this is not able to Set text inside tooltip window
plz explain another way if possible to solve this issue.
Thanks again ...
KarstenK 29-Aug-11 7:17am    
i remember that i didnt change the tooltip texts, but destroyed the old and created new ones.
R. S. Verma 5-Sep-11 1:55am    
Hi ,Could you explain how to delete existing tooltip and reset it again in same position??
Thakns..
KarstenK 26-Sep-11 3:24am    
delete the obejct with DestroyWindow
R. S. Verma 24-Nov-11 5:08am    
Hi karstenk
thanks to ur reply. I have tried according to ur suggestion but it is not working yet. Actually Am getting english text like "Click here to start" from start button and is is getting converted into unicode and again setting into same tooltip window.
It is converted properly into unicode but not able to set the unicode text in same tooltip window.
am using
::SendMessage(HWND,WM_GETTEXT,(WPARAM)iToolTipLen+1,(LPARAM)strToolTipText );//for getting english data from tooltip

and after converted this data into unicode trying to set using
::SendMessageW(hWndToolTip,WM_SETTEXT,NULL,(LPARAM)ToolTip_Unicode);

::SendMessage(W) -> W is for unicode
.
.
.
But it is not process as i need

WM_SETTEXT is successfully sending message and returning true
..
..
..
Can u plz tell me whats going wrong .... an not understanding what I should do ..???
Thanks ):(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900