From: Thomas S. <ct...@th...> - 2012-02-03 14:57:02
|
On Fri, 03 Feb 2012 06:28:16 +0100 (CET) Werner LEMBERG <wl...@gn...> wrote: > Yes, I will do that now. I thought there MUST be a way to be emulate > the convenient Unix way of having a single binary for both GUI and TTY > output (my program has a --tty command line switch), but I now see > that this isn't possible. You can do more than you might think. Take a look at the notes for things like AllocConsole(), AttachConsole(), FreeConsole(), etc. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682073%28v=vs.85%29.aspx As some windows only programmers may not be aware, some of the cross platform GUI libraries let you start with a real main() in all cases, alleviating the extra headache of winmain() in both portability and in schemes such as the above. Also, on newer windows versions there is a similar paradigm and api for desktops. However there is always a desktop - services and ssh spawned processes for instance just have desktops off in memory. ...and for completeness, there still is cygwin |