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?
SendMessageCall(hWnd, WM_SETTEXT, (IntPtr)value.Length, value);
I notice that getting the text IS WORKING
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?
thanks,
Dean
You don’t send a window message to force repaint, instead you call
InvalidateRect(hWnd, NULL, TRUE).