Is it possible to change the black color background to a different color?
If it is possible may sharing how to do it..
thanks
Is it possible to change the black color background to a different color?
If it is possible may sharing how to do it..
thanks
well....that is very system specific to be honest. There is not one standard way to do it.
Windows, Mac OS X, and Linux all have shells where you can physically change the background color options by selecting some kind of "preferences" menu (slightly varies depending on the OS).
But I know that's not what you want to know...you want to know how to do it in your program.
If you are using Windows/DOS: lots of older compilers came with a non-standard header file called dos.h that you could use to do some DOS specific stuff, including change the background color I believe...but most likely you won't have that file, and so that probably won't work.
Most likely you will have to use some sort of system() command to be able to do it...but I am not familiar with what the command would actually be....
This code is more specific to DOS . It works fine on DOS 5.1.2600 versionCode:#include <stdio.h> int main() { /* Some list of combinations 0 = Black 1 = Blue 2 = Green 3 = Aqua 4 = Red 5 = Purple 6 = Yellow 7 = White 8 = Gray 9 = Light Blue A = Light Green B = Light Aqua C = Light Red D = Light Purple E = Light Yellow F = Bright White */ printf("This is a console color change program\n"); system("COLOR F2"); /* This will change the bgcolor F - White and textcolor to 2- Green */ getchar(); return 0; }
ssharish2005
"DOS 5.1.2600" looks suspiciously liek the version of Windows XP SP2 to me. My Win2K shows "5.0.2195" when I do "ver" in a command prompt. I'm pretty darn sure there wasn't a "5.1.2600" version of MS-DOS (or PC-DOS for that matter).
--
Mats