How to set text on “another” win32 application

作者: admin 分类: 屏幕取词 发布时间: 2013-05-15 10:22 ė1,804 浏览数 6没有评论

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?

I notice that getting the text IS WORKING

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

只回答业务咨询点击这里给我发消息 点击这里给我发消息


本文出自 王牌软件,转载时请注明出处及相应链接。




电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">