Solved

Very simple ...I think

Posted on 2003-11-17
8
265 Views
Last Modified: 2010-04-01
I'm just learning c++ and i thought it would be cool for me to learn to do this

How do i change the font color in the DOS window in a Console Wizard project?

I'm using c++ 3
0
Comment
Question by:learning_t0_pr0gram
8 Comments
 
LVL 1

Expert Comment

by:igor_sk
ID: 9768974
Compile your console program and run it. DOS window will open.
Select Properties from the system menu.
Change a font to one of the list and press OK.
You will be prompted wether you want to 'Apply these settings to current window only' or to 'Save properties for future windows with the same title'.
Select 'Save properties for future windows with the same title' and press Ok.

After that any time you run this console applicatioin from dev studio, you will have the same font.
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 9768976
isn't there a line of coding to do it so when someone else opens it it will work?
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 9769042
that doens't change the color anyway.. how do i change the color of the text?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 5

Assisted Solution

by:lwinkenb
lwinkenb earned 20 total points
ID: 9769301
#include <wincon.h>

int main()
{
     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED);
     cout << "This should be red text";
     return 0;
}
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 9775864
when i put that, it goes into the wincon.h file and highlights:

typedef struct _COORD {
    SHORT X;
    SHORT Y;
} COORD, *PCOORD;

the SHORT X;

and it says "Type name executed"

??
0
 
LVL 1

Accepted Solution

by:
jploeg earned 20 total points
ID: 9778860
Use:
#include <windows.h>

instead of wincon.h
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 9782923
thanks, it works now
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 9782936
thanks, it works now
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question