-
To change text colour
Hi, straightforward question, what is the command used in visual studio to change the appearance of text color. Basically, I am writing a simple program which will contain a number of options and when a particular option is chosen I want it to flash a different colour momentarily.
Thanks,
Dirty.
;)
-
I've lost count of how many times this has been posted.
You can save yourself time by using the search facility
Code:
the colors can be mixed
FOREGROUND_BLUE Text color contains blue.
FOREGROUND_GREEN Text color contains green.
FOREGROUND_RED Text color contains red.
FOREGROUND_INTENSITY Text color is intensified.
BACKGROUND_BLUE Background color contains blue.
BACKGROUND_GREEN Background color contains green.
BACKGROUND_RED Background color contains red.
BACKGROUND_INTENSITY Background color is intensified.
#include <windows.h>
#include <stdio.h>
int main( void )
{
HANDLE hStdout;
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdout, FOREGROUND_RED);
printf("WWWWOOOOO MY TEXT IS RED WWOOOOO!!");
return 0;
}
-
tHANK YOU