How to set text on “another” win32 application
站长推荐:NSetup一键部署软件
一键式完成美化安装包制作,自动增量升级,数据统计,数字签名。应对各种复杂场景,脚本模块化拆分,常规复杂的脚本代码,图形化设置。无需专业的研发经验,轻松完成项目部署。(www.nsetup.cn)
I am using spy++ and see that the control I have has the decimal that matches the hex(after conversion of course) in spy++ and I see the parent window matches as well so I have the IntPtr for a Label and IntPtr for the form/window but my SendMessage
is not working to change the text in the target application.
Another approach may be may be to do something like this post but what is the control id and how do I get that SetText of textbox in external app. Win32 API
I assume the hWnd here needs to be the controls hWnd, correct?
1 |
SendMessageCall(hWnd, WM_SETTEXT, (IntPtr)value.Length, value); |
I notice that getting the text IS WORKING
1 |
SendMessageCall(hWnd, WM_GETTEXT, (IntPtr)sb.Capacity, sb); |
and I notice that I get the test, see the correct value, set the text yet it doesn’t change and then get the text again using SendMessage
AND it is the new value but the application still shows the wrong value….hmmm, do I need to send a repaint message maybe and if so, what is the code for that?
You don’t send a window message to force repaint, instead you call InvalidateRect(hWnd, NULL, TRUE)
.
http://stackoverflow.com/questions/8888710/how-to-set-text-on-another-win32-application
学习日记,兼职软件设计,软件修改,毕业设计。
本文出自 学习日记,转载时请注明出处及相应链接。
本文永久链接: https://www.softwareace.cn/?p=420