Solved

Very simple ...I think

Posted on 2003-11-17
8
264 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

777 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