Solved

Very simple ...I think

Posted on 2003-11-17
8
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

636 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