Click here to Skip to main content
15,905,232 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralAbout subclassing Pin
Eq4-Sep-00 7:05
Eq4-Sep-00 7:05 
GeneralCaption bar - how to add new button Pin
Stanik4-Sep-00 4:57
Stanik4-Sep-00 4:57 
GeneralRe: Caption bar - how to add new button Pin
zmike8-Sep-00 0:42
zmike8-Sep-00 0:42 
GeneralWorking directory of a process Pin
Eq3-Sep-00 18:43
Eq3-Sep-00 18:43 
GeneralRe: Working directory of a process Pin
Michael Dunn3-Sep-00 19:47
sitebuilderMichael Dunn3-Sep-00 19:47 
GeneralRe: Working directory of a process Pin
Tim Deveaux4-Sep-00 4:02
Tim Deveaux4-Sep-00 4:02 
GeneralC++ Console Application Pin
Graeme3-Sep-00 12:51
Graeme3-Sep-00 12:51 
GeneralRe: C++ Console Application Pin
Tim Deveaux3-Sep-00 14:52
Tim Deveaux3-Sep-00 14:52 
There are lots of great things you can do with the console api.

First you get a handle to the console:
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);


This may be 0 - as long as its not INVALID_HANDLE_VALUE you're ok. (Note - you'll need to #include <windows.h>)

Now you can set colors. This sets white text on a red background:
SetConsoleTextAttribute(hConsole, FOREGROUND_RED |
     FOREGROUND_GREEN | FOREGROUND_BLUE |
     BACKGROUND_RED);


I tested with printf, and assume cout is ok. You might like to investigate the fns like WriteConsole etc. Search for "Console functions" in the msdn. There is stuff for positioning too.
General** Passing Variable Values to other Dialog Boxes ** Pin
Steve Lai3-Sep-00 12:22
Steve Lai3-Sep-00 12:22 
GeneralRe: ** Passing Variable Values to other Dialog Boxes ** Pin
Tim Deveaux3-Sep-00 15:08
Tim Deveaux3-Sep-00 15:08 
GeneralRe: ** Passing Variable Values to other Dialog Boxes ** Pin
#realJSOP3-Sep-00 17:06
professional#realJSOP3-Sep-00 17:06 
GeneralPrint CRichEditCtrl from CView Pin
David Pokluda3-Sep-00 8:10
David Pokluda3-Sep-00 8:10 
GeneralRe: Print CRichEditCtrl from CView Pin
jschacker5-Sep-00 3:42
jschacker5-Sep-00 3:42 
GeneralRe: Print CRichEditCtrl from CView Pin
jschacker6-Sep-00 13:00
jschacker6-Sep-00 13:00 
GeneralPrint Information Pin
David Pokluda3-Sep-00 8:08
David Pokluda3-Sep-00 8:08 
QuestionHow to get a CWnd background color Pin
zhiying3-Sep-00 5:07
susszhiying3-Sep-00 5:07 
AnswerRe: How to get a CWnd background color Pin
Tim Deveaux3-Sep-00 15:14
Tim Deveaux3-Sep-00 15:14 
QuestionHow to get a CWnd background color Pin
zhiying3-Sep-00 5:07
susszhiying3-Sep-00 5:07 
QuestionHow to get a CWnd background color Pin
zhiying3-Sep-00 5:07
susszhiying3-Sep-00 5:07 
QuestionWhat's a debug assertion ??? Pin
P0lO3-Sep-00 4:47
P0lO3-Sep-00 4:47 
AnswerRe: What's a debug assertion ??? Pin
Tim Deveaux3-Sep-00 7:43
Tim Deveaux3-Sep-00 7:43 
GeneralRe: What's a debug assertion ??? Pin
P0lO4-Sep-00 7:58
P0lO4-Sep-00 7:58 
GeneralRe: What's a debug assertion ??? Pin
Member 12089654-Sep-00 10:34
Member 12089654-Sep-00 10:34 
GeneralCDialogBar in CView Pin
Erik3-Sep-00 0:06
Erik3-Sep-00 0:06 
GeneralRe: CDialogBar in CView Pin
jschacker5-Sep-00 4:56
jschacker5-Sep-00 4:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.