Hello
Can any one the code required to
change the console background color
or the color of user screen
Thank you
Kishore
Printable View
Hello
Can any one the code required to
change the console background color
or the color of user screen
Thank you
Kishore
http://cboard.cprogramming.com/showp...05&postcount=7 or the faq somewhere
A second way would be
using this function:Code:DrawColorString("",0,5,FOREGROUND_RED | FOREGROUND_GREEN);
Code:void DrawColorString(string szText, int X, int Y, WORD color)
{
HANDLE OutputH;
COORD position = {X, Y};
OutputH = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(OutputH, color);
SetConsoleCursorPosition(OutputH, position);
cout << szText;
Its in the FAQ. Just change (I'm assuming your using windows) this:
To this:Code:SetConsoleTextAttribute ( h, FOREGROUND_RED | FOREGROUND_INTENSITY );
Code:SetConsoleTextAttribute ( h, BACKGROUND_RED | BACKGROUND_INTENSITY );