In Windows, is there a way to launch a process in C++ and then read what it spat out into stdout when it's done? The process must be run using elevated privileges (on Vista or later) if necessary.
I'm currently using ShellExecuteEx() to launch the process and running a while-loop until GetExitCodeProcess() no longer returns STILL_ACTIVE via the lpExitCode parameter (with a WaitForSingleObject() call doing a 100 msec wait during each iteration).
ShellExecuteEx()
with therunas
verb. AndShellExecuteEx()
doesn't support output redirection AFAICT.