|
From: Frank R. <fra...@gm...> - 2010-02-09 22:29:04
|
On 09.02.2010 22:28, Bastian Eicher wrote:
> GUI applications:
> These apps have no default streams. They can never output to the console and
> therefore don't come with a forced Terminal window. They can only display
> GUI windows.
> pythonw.exe is an example for such an application.
Not correct.
AFAIK they still have input/output handles. Providing alternatives for
these (eg with CreateProcess(), or at runtime in the process itself) and
data will still go there, provided the application actually does output
something to stdout.
Though, launching a GUI app from a console doesn't automatically
"connect" the process' handles to the console.
But getting a console window in a GUI app is also possible, but it has
to be done manually (AllocConsole()). Also, the runtime library has to
be "told" about that as well (freopen ("CONOUT$", "w", stdout)).
In summary: GUI apps still have, and can use, stdout/stdin/stderr. But
what they 'point' to, by default, differs.
-f.r.
|