Discussion:
DETACHED_PROCESS, no-console and stdout
(too old to reply)
Martin T.
2005-06-21 13:54:31 UTC
Permalink
Hi all.

I was just wondering ... when I start a console app with CreateProcess
and the DETACHED_PROCESS flag, it will not have a console.

Now, I'm wondering into which nirvana will the App send its stdout?

best regards,
Martin Trappel
Kellie Fitton
2005-06-21 14:54:38 UTC
Permalink
Hello,

The DETACHED_PROCESS flag causes the console window to be Hidden until
you use the win32 API "AllocConsole" to create a console at a later
time and
make it Visible, if you want the Console window to be visible by
default, do NOT
use the DETACH_PROCESS flag, just use the default flag, which I think
is the
CREATE_NEW_CONSOLE (default).

Hope these information helps.

Kellie.
Martin T.
2005-06-21 18:01:44 UTC
Permalink
Post by Kellie Fitton
Hello,
The DETACHED_PROCESS flag causes the console window to be Hidden until
you use the win32 API "AllocConsole" to create a console at a later
time and
make it Visible, (...)
I know. I was just curious what happens with stdout while the console
is "hidden".

Hmm ... "hidden" would imply that I then see on the newly created
console-window what was previously written to stdout?
James Brown wrote that it's redirected to NUL.
So ... ?

best regards,
Martin
Kellie Fitton
2005-06-21 18:36:26 UTC
Permalink
Hi,

Take a look at this article from microSoft, it should give you some
good ideas.

http://support.microsoft.com/default.aspx?scid=kb;en-us;190351

Good luck, Kellie.
Martin T.
2005-06-21 19:01:06 UTC
Permalink
Post by Kellie Fitton
Hi,
Take a look at this article from microSoft, it should give you some
good ideas.
http://support.microsoft.com/default.aspx?scid=kb;en-us;190351
Ah yes, piping and handle inheritance ... not exactly the most
intuitive of sciences :)

thanks for yer help,
best regards,
Martin
Kellie Fitton
2005-06-21 19:22:09 UTC
Permalink
You are welcome.

Kellie. :---))

James Brown
2005-06-21 15:55:10 UTC
Permalink
The stdout/stdin/stderr handles are redirected to null pipes,
essentially the same as /dev/nul under unix

James
--
www.catch22.net
Free win32 software, sourcecode and tutorials
Post by Martin T.
Hi all.
I was just wondering ... when I start a console app with CreateProcess
and the DETACHED_PROCESS flag, it will not have a console.
Now, I'm wondering into which nirvana will the App send its stdout?
best regards,
Martin Trappel
Loading...