Getting output from executed shell program

Started by
8 comments, last by emileej 19 years, 10 months ago
[platform] Language=C++ System=Windows [/platform] I would like to gain access to the output of a shell program I currently run using ShellExecute. How is that done?
Emil Johansen- SMMOG AI designerhttp://smmog.com
Advertisement
On MSDN: Creating a Child Process with Redirected Input and Output
Thanks, but before I go into it: In the example it seems that the child process'' programming is directed towards its existence as a child process. The program I am targeting is a standalone which I have not programmed and to the source of which I have do not have access.
Emil Johansen- SMMOG AI designerhttp://smmog.com
The technique works with normal C/C++ file console I/O techniques in the child process.

[edited by - SiCrane on May 26, 2004 8:27:42 PM]
Great. Thanks. Ill look into it :D
Emil Johansen- SMMOG AI designerhttp://smmog.com
Ok I got it working like a charm now, but I have lost some functionality from ShellExecute that I really liked. When I create the process using this method I do not have the option of hiding the window associated with it. How is that done in this case?
Emil Johansen- SMMOG AI designerhttp://smmog.com
Check out the member variables of the STARTUPINFO structure you pass to CreateProcess(). One of them should be wShowWindow, which you can use to pass any show window flags that you could use with ShellExecute().
Hmm... Thats wierd. I tried to use it like this:
siStartInfo.wShowWindow = SW_HIDE;

But is does not seem to be working.
Emil Johansen- SMMOG AI designerhttp://smmog.com
Did you set the STARTF_USESHOWWINDOW flag with dwFlags member variable of the STARTUPINFO structure?
Argh. No. Sorry. Thanks for your help.
Emil Johansen- SMMOG AI designerhttp://smmog.com

This topic is closed to new replies.

Advertisement