how do yo umake colored text and backround for VC++ 6.0? i have tried things but they dont work... any ideas?
Printable View
how do yo umake colored text and backround for VC++ 6.0? i have tried things but they dont work... any ideas?
I suppose you mean how to choose the colors VC++ chooses for keywords and such.
Tools->Options->Format (on the far right)
no....
actually, what i wanted to know was how to change the color of the output text that the user will see
Console or GUI app?
Console: SetConsoleTextAttribute
GUI: SetTextColor, SetBkColor
umm no its in a console application.. thanks if you can help me
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), flags);
flags can be any combination of the following:
FOREGROUND_BLUE, FOREGROUND_GREEN, FOREGROUND_RED, FOREGROUND_INTENSITY, BACKGROUND_BLUE, BACKGROUND_GREEN, BACKGROUND_RED, and BACKGROUND_INTENSITY
I think they are self-explaining.
hmmm, well i kind of see what your saying, but i cant get it to work, are there certain files i need to include or what?
if you want you could show me a sample where this works.
This text will be yellow on blue background.Code:#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY |
BACKGROUND_BLUE | BACKGROUND_INTENSITY);
cout << "hello" << endl;;
return 0;
}
i tried that, but i get this error....
c:\source\t hall\test progs\colors.cpp(3) : error C2871: 'std' : does not exist or is not a namespace
NEVERMIND, I GOT IT TO WORK, THANKS A LOT