From: TROCHU X. <xt...@ya...> - 2003-05-21 16:29:58
|
--- Greg Chicares <chi...@mi...> wrote: > psksvp wrote: > > > > If I build a Win32 app with flag -mwindows, I > wonder if there is a way to > > enable console output from printf, to the > console(sh) that I start the > > program(started from commandline in msys sh)? > > IIRC, a pure GUI app can't have a console, > but a console app can have a GUI. > Not completly correct. You can create a console with a GUI application, using AllocConsole() but : _ It is a new console, not the one where you start the program. _ You can't directly call printf in it. You have to link the windows HANDLE to mscrt handle then to stdio FILE *. Looking at MSDN, you can call AttachConsole() to attach your process to the console of another process, but you have to know it's Process ID. And it's only available for XP. Xavier __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |