I have no idea on how to change the colors in the programs i write i.e
void main()
{
cout << "hello" <<endl;
}
how would i go about making the word hello blue or yellow Ect.
Printable View
I have no idea on how to change the colors in the programs i write i.e
void main()
{
cout << "hello" <<endl;
}
how would i go about making the word hello blue or yellow Ect.
You have to resort to Console functions to do this.
SetConsoleTextAttribute will do specifically what you are after.
You will need a handle to the console to use this and you can get it with :
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
There are samples that illustrate more of what you can do with the console.
How retro textual! (sorry)
You could learn all about ANSI.SYS (yech!) or look up the SetConsoleTextAttribute function (wincon.h) in the help system.
Have fun,
Dave Relyea
P.S. SetConsoleTextAttribute requires NT 3.1+ or Win9x.
What is ansi.sys or that other one??
I really ahve know idea what ths stuff is and if you could help out thanx.
WHere do i find the exaples at?
<b> WippKreem <\b> Sent this message
<email> [email protected]<\email>
There is a sample that comes with MSVC called Console.