|
From: KC <kc...@gm...> - 2011-01-15 19:55:30
|
Hi,
I have a application compiled with options "-mwindows -D_WIN32_WINNT=0x0501".
To create a DOS window, I used:
AttachConsole(ATTACH_PARENT_PROCESS)
freopen("CONOUT$", "wb", stdout);
freopen("CONOUT$", "wb", stderr);
_ERR = GetStdHandle(STD_ERROR_HANDLE);
_OUT = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(_ERR, FOREGROUND_RED)
printf("HELLO\n");
Everything works OK. If I start my app. from DOS windows,
the red "HELLO" will be display on console.
However, if I start my app from MSYS, the color disappear !!
If I recompile my app without -mwindows and remove
AttachConsole() and freopen(). The MSYS console does
display the red "HELLO" properly.
Anyone know how to solve this MSYS color problem with AttachConsole() ?
Thanks
Regards,
KC
|