This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: console IO in GUI apps


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]