Computing.Net > Forums > Programming > How to change font and background c

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to change font and background c

Reply to Message Icon

Name: Miroslav
Date: May 14, 2004 at 15:54:38 Pacific
OS: Win XP
CPU/Ram: AMD Athon
Comment:

Do you know how to change the colors of the fonts and the background in a console application ?

Thanks in advance for your help ...

Miroslav.




Sponsored Link
Ads by Google

Response Number 1
Name: Miroslav
Date: May 14, 2004 at 16:02:45 Pacific
Reply:


I forgot to say: this is a C Programming Problem.

Miroslav.


0

Response Number 2
Name: anonproxy
Date: May 14, 2004 at 19:51:23 Pacific
Reply:

The stdlib function system would be the simplest way. system("string"); sends string as an argument to the shell. In Windows NT/2000/XP, the command color changes the background and/or foreground (text) colors. It follows hex notation. Use this chart.

For font, I don't know how to affect that from the shell. I've only seen two fonts in a Windows console (the old raster version and the newer smooth one). Regardless, a registry value should hold it, so you might have to run a batch file.


0

Response Number 3
Name: Victor516
Date: May 18, 2004 at 21:06:04 Pacific
Reply:

use include conio.h
for background color use the function bgcolor() I use to pass a number in the function. I was never really sure what color you get for what int. for font color use textcolor() and pass an int in the () like in bgcolor. the color is only used for functions in conio.h so for print f use cprintf. look up the functions in conio.h


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How to change font and background c

How to change a windows background www.computing.net/answers/programming/how-to-change-a-windows-background/7357.html

how to change the start button icon www.computing.net/answers/programming/how-to-change-the-start-button-icon/755.html

About C and/or C++ (how to) www.computing.net/answers/programming/about-c-andor-c-how-to/12569.html