Jump to content

  • Log In with Google      Sign In   
  • Create Account

Changing text color in console applications with C++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Yanroy   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 December 1999 - 09:45 AM

Can anyone tell me how to change the text color in an MS-DOS type console window? I am running it under windows 98. I am using metrowerks codewarrior, which does not seem to like conio.h (causes a link error). At first I tried to use conio.h, but as I said just a second ago, it caused a link error. Then I tried to use the system() function to use the ANSI escape color codes from the MS-DOS prompt, only to find out that the Metrowerks Standard Library files have a system() function that doesn't do anything, and always returns 0! Please help!

Sponsor:

#2 lshadow   Members   -  Reputation: 123

Like
Likes
Like

Posted 01 December 1999 - 09:45 AM

You can use

textcolor(x)

Where x is a number 0 - 15, and if you add 128 to x you can make it blink.

textcolor() is defined in the conio.h file, and you also have to make sure you use a writing function that supports the textcolor feature. cprintf() is one of them, which is basically the same thing as printf.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS