• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

Very simple ...I think

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
learning_t0_pr0gram
Asked:
learning_t0_pr0gram
2 Solutions
 
igor_skCommented:
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
 
learning_t0_pr0gramAuthor Commented:
isn't there a line of coding to do it so when someone else opens it it will work?
0
 
learning_t0_pr0gramAuthor Commented:
that doens't change the color anyway.. how do i change the color of the text?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
lwinkenbCommented:
#include <wincon.h>

int main()
{
     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED);
     cout << "This should be red text";
     return 0;
}
0
 
learning_t0_pr0gramAuthor Commented:
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
 
jploegCommented:
Use:
#include <windows.h>

instead of wincon.h
0
 
learning_t0_pr0gramAuthor Commented:
thanks, it works now
0
 
learning_t0_pr0gramAuthor Commented:
thanks, it works now
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now