Solved

Very simple ...I think

Posted on 2003-11-17
8
262 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now