Archived

This topic is now archived and is closed to further replies.

emileej

Getting output from executed shell program

Recommended Posts

[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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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().

Share this post


Link to post
Share on other sites