WM_SETTEXT消息发送到tooltips_class32句柄 [英] WM_SETTEXT message send to tooltips_class32 handle

查看:168
本文介绍了WM_SETTEXT消息发送到tooltips_class32句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,专家
嗨想要为工具提示窗口设置文本
我编写了以下代码以从工具提示中读取文本:

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);


但无法在运行时更改工具提示文本
你能帮我解释一下这段代码出了什么问题吗?我还需要做些额外的事情吗?

感谢adv.


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.

推荐答案

SendMessageW ???? => SendMessage(无W)

并且第一个代码段中的缓冲区需要更长
SendMessageW??? => SendMessage (without W)

and the buffer in the first snippet needs to be longer


这篇关于WM_SETTEXT消息发送到tooltips_class32句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆