mdog has asked for the wisdom of the Perl Monks concerning the following question:
How does one go about taking control of a program that is running on Windows?
Basically, I want to take control a program and tell it to exit properly (because if it exits on its own, it saves a bunch of data automatically. If I just kill the PID, then nothing gets saved).
After figuring out the classname from spy.exe, I am able to do this:
use Win32::GUI; $smartboardHandle = Win32::GUI::FindWindow("TMainform", "");
to get a handle for the program and I know the next step would be to issue SendMessage commands but since I don't know the API of the program, I think I am SOL (unless there is a standard message that says "Hey, why don't you close").
I have tried Win32::Process but invariably, I all I can do is kill the PID and that doesn't get the "Save and Close" I am looking for.
So any Windoze hackers have any clues for me?
Thanks,
Mdog
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Controlling a program in Windows
by Thelonius (Priest) on Jan 27, 2003 at 18:37 UTC | |
|
Re: Controlling a program in Windows
by ibanix (Hermit) on Jan 27, 2003 at 19:19 UTC | |
|
Re: Controlling a program in Windows
by Mr. Muskrat (Canon) on Jan 27, 2003 at 18:18 UTC | |
|
Re: Controlling a program in Windows
by mdog (Pilgrim) on Jan 27, 2003 at 19:22 UTC |