cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Changing the Color of text
Changing the Color of text
Mar 17, 2012 at 9:44pm UTC
Jesus805
(26)
Hello,
I'm currently doing a project and I need a way to color my console text temporarily, I need to create a certain part of my text a certain color, then another part of my text a different color, so system("color 00") is out of the question.
Also is there a function where you can change the text color based on RGB?
like
http://en.wikipedia.org/wiki/List_of_colors
Any help would be greatly appreciated
Mar 17, 2012 at 9:46pm UTC
Texan40
(645)
call GetConsoleWindow() to get a handle to the console then call SetConsoleTextAttribute() to change color, etc.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683175(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ms686047(v=vs.85).aspx
Topic archived. No new replies allowed.