Adding text in another application
-
I am trying to interface with another application and I want to add text to a edit box in it. I have the HWND for the window but I can't figure out how to get text to show in the box. I have tried to use WM_SETTEXT, but that isn't working. Is there another way I should be looking for to do this? Thanks. Quinn
-
I am trying to interface with another application and I want to add text to a edit box in it. I have the HWND for the window but I can't figure out how to get text to show in the box. I have tried to use WM_SETTEXT, but that isn't working. Is there another way I should be looking for to do this? Thanks. Quinn
Is the
HWND
you've got the handle of the editbox, or of its parent? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Is the
HWND
you've got the handle of the editbox, or of its parent? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
I have both the handle to the parent and the handle to the control. I use FindWindow to get the parent and FindWindowEx to get the control HWND.
Ummm... it should work. Things you can do to locate the problem:
- Make sure you spotted the right parent window by sending the
WM_SETTEXT
message to it --the window caption should change accordingly. - Make sure the handle actually belongs to the edit box using Spy++, a little utility that comes with VC++ and is able to inspect the internals of currently active windows.
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
- Make sure you spotted the right parent window by sending the
-
Ummm... it should work. Things you can do to locate the problem:
- Make sure you spotted the right parent window by sending the
WM_SETTEXT
message to it --the window caption should change accordingly. - Make sure the handle actually belongs to the edit box using Spy++, a little utility that comes with VC++ and is able to inspect the internals of currently active windows.
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
I have been using SPY++, but thanks for suggesting it. That's how I made sure I had the rigth window. One of the things I've noticed with some testing is that this is a subclassed control. Also with SPY++ I can see that the control has a 'caption' to it that says 'trillian display' and when I use the WM_SETTEXT to the control it will change that value. But nothing shows anywhere. SPY++ also showz that the control class is 'trillian display' Does that help narrow down the possibilities any?
- Make sure you spotted the right parent window by sending the
-
I have been using SPY++, but thanks for suggesting it. That's how I made sure I had the rigth window. One of the things I've noticed with some testing is that this is a subclassed control. Also with SPY++ I can see that the control has a 'caption' to it that says 'trillian display' and when I use the WM_SETTEXT to the control it will change that value. But nothing shows anywhere. SPY++ also showz that the control class is 'trillian display' Does that help narrow down the possibilities any?
I'm afraid you're out of luck. This control is not a standard edit box and seems not to be using the "caption" as the displayed message (which is how edit boxes behave). Maybe there's some custom message than can be used to set this control's content, but unless you've got additional info this is like looking for a needle in a haystack. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
I have been using SPY++, but thanks for suggesting it. That's how I made sure I had the rigth window. One of the things I've noticed with some testing is that this is a subclassed control. Also with SPY++ I can see that the control has a 'caption' to it that says 'trillian display' and when I use the WM_SETTEXT to the control it will change that value. But nothing shows anywhere. SPY++ also showz that the control class is 'trillian display' Does that help narrow down the possibilities any?
i used something similar to u before, but not WM_SETTEXT. i had HWND of a window in another app, i used PostMessge to send a set of command (different numbers) for communicating between the 2 apps. i suggest u try PoseMessage(hwnd_Peer, WM_USER+???,a_number,0) first to see if another app can receive the message with a number, it should be OK. i only suspect u can't send a string from one app to another, but not sure, because COM can't send a string in this way vs its method. includeh10
-
i used something similar to u before, but not WM_SETTEXT. i had HWND of a window in another app, i used PostMessge to send a set of command (different numbers) for communicating between the 2 apps. i suggest u try PoseMessage(hwnd_Peer, WM_USER+???,a_number,0) first to see if another app can receive the message with a number, it should be OK. i only suspect u can't send a string from one app to another, but not sure, because COM can't send a string in this way vs its method. includeh10
-
I'm afraid you're out of luck. This control is not a standard edit box and seems not to be using the "caption" as the displayed message (which is how edit boxes behave). Maybe there's some custom message than can be used to set this control's content, but unless you've got additional info this is like looking for a needle in a haystack. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Yea, that is kinda what I was thinking too. but there has to be a away, I must be able to make the computer do as I wish, hehe. So I guess I email the programmers of the program and see if they will help me any. Thanks for all your help, and if any more information about this can help me, please let me know. Quinn
-
I don't see any info on PostMesage in the MSDN, where can I find some info on that? (edit - nevermind I found the page in the msdn)
sorry, right function name is : PostMessage (return at once) or SendMessage (return after executing). includeh10