[Qt-interest] stdout of MSWin GUI application run from console

Witteveen, Arnt ArntW at enfocus.com
Wed Apr 13 16:52:45 CEST 2011


His code uses only one fucntion really, "AttachConsole". From it's help
here: http://msdn.microsoft.com/en-us/library/ms681952%28VS.85%29.aspx
when you pass it -1 as param, "Use the console of the parent of the
current process."

I'm guessing that if a non-console application spawns his application,
it might still not work? 

But it should work in most normal situations (I didn't try), it uses a
documented windows api function that does just that it seems.
Arnt

> -----Original Message-----
> From: qt-interest-bounces+arntw=enfocus.com at qt.nokia.com 
> [mailto:qt-interest-bounces+arntw=enfocus.com at qt.nokia.com] 
> On Behalf Of Paul Miller
> Sent: woensdag 13 april 2011 16:34
> To: qt-interest at qt.nokia.com
> Subject: Re: [Qt-interest] stdout of MSWin GUI application 
> run from console
> 
> On 4/13/2011 9:18 AM, Graeme Gill wrote:
> > Paul Miller wrote:
> >> This just isn't possible (easily) on Windows.
> >
> > Instead of saying "this is impossible", how about trying the code 
> > first.
> 
> Graeme - I must apologize I thought you were asking how to do 
> it. I've seen code like what you've posted there but never 
> got it to work reliably. How do you know when your program is 
> launched from a console versus the UI/Explorer?
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
> 



More information about the Qt-interest-old mailing list