关于网友提出的“ 如何防止改窗口标题(是不是截获WM_SETTEXT消息就可以)”问题疑问,本网通过在网上对“ 如何防止改窗口标题(是不是截获WM_SETTEXT消息就可以)”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 如何防止改窗口标题(是不是截获WM_SETTEXT消息就可以)
描述: 现在有个程序,无法获取名称,GetWindowText返回空串。但是 ,Spy++可以正常操作,不知道是用的什么技术。
解决方案1: 不要用GetWindowText
用SendMessage
TCHAR WindowText[30]={0};
::SendMessage(m_hWnd,WM_GETTEXT,(WPARAM)(sizeof(WindowText)/sizeof(TCHAR)),(LPARAM)WindowText);
trace(WindowText);
解决方案2: To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.
解决方案3: The GetWindowText function copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application.
以上介绍了“ 如何防止改窗口标题(是不是截获WM_SETTEXT消息就可以)”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/3320425.html