![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2006
Posts: 10
Rep Power: 0
![]() |
Console Background
Hello
Can any one the code required to change the console background color or the color of user screen Thank you Kishore |
|
|
|
|
|
#2 |
|
Programmer
|
There are two modes
In graphics mode use setbkcolor(colorNumber); In text mode use textbackground(colorNumber); colorNumber = 0-255 in Graphics mode, 0-15 in textMode
__________________
Iftikhar Ahmed Khan For doing an experiment on programmer's mood please visit http://uxisfyp1.brunel.ac.uk/cspgiak |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
There is no standard C++ way of doing this, as the operation is platform specific. On top of that, it's usually OS specific, as well. You don't mention either of those things, so a definitive answer isn't possible.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Apr 2006
Posts: 155
Rep Power: 3
![]() |
In Windows you can change the textcolor and textbackgroundcolor in the console.
#include <windows.h> // ... HANDLE MyHandle = GetStdHandle(STD_OUTPUT_HANDLE); SetColorTextAttribute(MyHandle, FOREGROUND_WHITE | BACKGROUND_RED);
__________________
-- v0id
|
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Mar 2005
Location: Student of University of Mumbai, Maharashtra State, India
Posts: 344
Rep Power: 4
![]() |
In Windows XP, if you are using Turbo C++ 3.0, you can use the system function to change the console background color.
Try running color command in Windows XP. Find out more, by typing color /?
__________________
Visit: http://www.somaiya.edu |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pause \ stop background worker | john Wesley | Visual Basic .NET | 1 | Aug 21st, 2006 9:31 AM |
| The Black Art of Video Game Console Design | lostcauz | Book Reviews | 0 | Apr 26th, 2006 8:31 PM |
| background images | boz | Java | 0 | Sep 11th, 2005 6:02 PM |
| Neat little program... | Sane | Python | 3 | Apr 10th, 2005 6:49 PM |
| Printing rich text with colored background | jarrod | C# | 1 | Feb 23rd, 2005 12:48 PM |