-
desperate need of help!!!!
I'm working on a c++ program for a school project and I'm in desperate need
of help. Is there anyway i can change the background color of the program
from black to white? I've tried SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
BACKGROUND_GREEN); but it only changes the background within the font. Is
there any other way to change the background's color?
-
Re: desperate need of help!!!!
"gokul_k" <write2gokul@hotmail.com> wrote:
>
>I'm working on a c++ program for a school project and I'm in desperate need
>of help. Is there anyway i can change the background color of the program
>from black to white? I've tried SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
>BACKGROUND_GREEN); but it only changes the background within the font. Is
>there any other way to change the background's color?
When you first create your buffer you can set the foreground and background
using SetConsoleTextAttribute() to fill your whole buffer. M$ publishes a
little routine that is used to 'clear' a screen, you can adapt that to "color"
a screen.
http://support.microsoft.com/default...b;EN-US;Q99261
A cheap trick, (if you really aren't planning to use different colors is:
system("color 70"); // at the start of your program
...
system("color"); // at the end of your program
this will produce black text on white.
Type "color /?" on the cmd line to see your other options.
-
Re: desperate need of help!!!!
"ralph" <nt_consulting32@hotmail.com> wrote:
> ...
>A cheap trick, (if you really aren't planning to use different colors is:
> system("color 70"); // at the start of your program
> ...
> system("color"); // at the end of your program
>
>this will produce black text on white.
>Type "color /?" on the cmd line to see your other options.
> ...
I lied. The default color call ("color") will not work to set console colors
back to the default inside a program on some windows versions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks