Reading contents of other apps Window
-
Hi all, I want to "control" an application with a second one. The app it there to control a Hardware and I don't have the code:(. It is command-based: I can write a command in a CEdit-like window, and the response is displayed in the same window. ( a Hexdump, maybe ) Is it possible to grap the contents of this window and to write ( from my own app ) into it? Somethink like enumerateWindow and then access over the clipboard? :confused: Thanks , Hardy.
-
Hi all, I want to "control" an application with a second one. The app it there to control a Hardware and I don't have the code:(. It is command-based: I can write a command in a CEdit-like window, and the response is displayed in the same window. ( a Hexdump, maybe ) Is it possible to grap the contents of this window and to write ( from my own app ) into it? Somethink like enumerateWindow and then access over the clipboard? :confused: Thanks , Hardy.
If you have a handle to the (edit) control, you can use
GetWindowText()
to get its contents.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
If you have a handle to the (edit) control, you can use
GetWindowText()
to get its contents.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
DavidCrow wrote:
If you have a handle to the (edit) control, you can use GetWindowText() to get its contents.
I think its not so simple. The Application ( A1 ) to control the Hardware is ready and closed. I am writing a new App ( A2 ) , in mfc, to do some extra-work. Now I want to access A1`s main window. I want to write to it and read from it from within A2. Thanks, Hardy.
-
DavidCrow wrote:
If you have a handle to the (edit) control, you can use GetWindowText() to get its contents.
I think its not so simple. The Application ( A1 ) to control the Hardware is ready and closed. I am writing a new App ( A2 ) , in mfc, to do some extra-work. Now I want to access A1`s main window. I want to write to it and read from it from within A2. Thanks, Hardy.
Hardy_Smith wrote:
The Application ( A1 ) to control the Hardware is ready and closed...Now I want to access A1`s main window.
How do you expect to read from a non-existent window?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
Hardy_Smith wrote:
The Application ( A1 ) to control the Hardware is ready and closed...Now I want to access A1`s main window.
How do you expect to read from a non-existent window?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
With closed I mean closed-source. I don't have the source. The window itselve is open, of course. Sorry, it was not clear.
-
With closed I mean closed-source. I don't have the source. The window itselve is open, of course. Sorry, it was not clear.
Like I said before, get a handle to the (edit) control (using
FindWindow()
), then useGetWindowText()
to get its contents.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb