This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Re: console IO in GUI apps
- To: cygwin-xfree at cygwin dot com
- Subject: Re: console IO in GUI apps
- From: <huntharo at msu dot edu>
- Date: Sun, 21 Oct 2001 14:21:49 EDT
Christopher Faylor <cgf@redhat.com> said:
> >I would also mention that there is an AttachConsole where you can use
> >an already existing console, you just have to know the console owner's
> >PID.
>
> The MSDN documentation indicates that AttachConsole is available on
> Windows XP only. It's not a generic solution.
Win32's SetStdHandle () will allow us to attach to an already open console.
However, we have to get the process id of the launching console before we can
figure out what console handles we will pass to SetStdHandle (). I've tried
looking for functions like GetParentProcess (), etc. but so far I can't find
a function that will return a handle, or the process id, of the launching
process.
Does anyone know of such a function?
Harold