Changing Text Color in Console App
I was wondering how someone would change the color of the text in a Console App?
Thanks
Check out this tutorial:
http://www.c-for-dummies.com/lessons/chapter.13/05/
Edited by - Bino on July 19, 2000 3:39:40 AM
http://www.c-for-dummies.com/lessons/chapter.13/05/
Edited by - Bino on July 19, 2000 3:39:40 AM
July 19, 2000 02:05 PM
That''s a fine reference for DOS.
Basically, assuming you''re using C/C++, there is no standard method for changing text color. You need to use OS and/or compiler specific methods. C didn''t have one because at the time there was no such thing as colored text unless you physically changed the ribbon in your line printer. The C++ designers probably just didn''t think it important enough.
For DOS see above.
For Win32 take a look at GetStdHandle/SetConsoleTextAttribute().
Other systems will have other methods, all different.
-Mike
Basically, assuming you''re using C/C++, there is no standard method for changing text color. You need to use OS and/or compiler specific methods. C didn''t have one because at the time there was no such thing as colored text unless you physically changed the ribbon in your line printer. The C++ designers probably just didn''t think it important enough.
For DOS see above.
For Win32 take a look at GetStdHandle/SetConsoleTextAttribute().
Other systems will have other methods, all different.
-Mike
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement