ok i've found the solution in order to give Win32-GUI-apps a linux-like behaviour ( but it needs at least WinXP )
with
AttachConsole() AttachConsole(ATTACH_PARENT_PROCESS);
freopen("CON", "wt", stdout); // redirects stdout
you can attach the GUI app to an existing console window, if there exists one,
with other words, if it was started from the commandline from a console window.
attached is a sample project which demonstrates this
run the Release build from a console window and enjoy the debug messages
the code which i can't find anymore did that AttachConsole-stuff also for older Windozes like Win98, ME, NT etc...
if you use MinGW-win32api-3.7 the headers already contain the needed defines,
otherwise i've added them to the code and you need to enable them.
[attachment deleted by admin]