How to Spawn a Console App and Redirect Standard HandlesLast reviewed: August 5, 1996Article ID: Q126628 |
The information in this article applies to:
This article discusses spawning a console application with CreateProcess() and redirecting its output. The standard handles are controlled with the STARTUPINFO fields hStdInput, hStdOutput, and hStdError. In Windows NT version 3.1, if a windowed application spawned a console application, you could:
In Windows NT version 3.5 and later and in Windows 95, if you set any of these fields to INVALID_HANDLE_VALUE, Windows NT will assign the default value to that handle in the console application, rather than leaving it an invalid value. Therefore, if you set STARTF_USESTDHANDLES, but fail to set one of the handle fields, this will not cause a problem for the console application. You can now redirect standard input, but not standard output, and so forth.
|
Additional reference words: 3.50 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |