MSDN question again...
-
ok,... i like to type my questions in, like using the index in MSDN. my question this time will be textcolor "like changing it from white to blue or somthing like that." I first jumped into MSDN to look up text color,... in Index mode there are three C++ things i can choose from. "I want to do everything using the win32 app console project... (just noting it :)) there is: 1. Visual C++ Documintation. 2. Visual C++, platform SDK, and win ce docs and 3. visual c++, platform SDK, and enterprise docs. first question is: What one should i select to get the results to my questions most relative? second question is: how do i now what help files will help me with my project "win32 con. app." so that i dont get them consfused with MFC n so n so? Third question is: How do you use the syntax that the help files give you? "there is a bunch of code that i do not know how to use... the help files just list the code and seem to hope you know hoe to apply it to you code" (I dont know how to apply it)(to make it work) :) Thanks for the help! ~SilverShalkin :rose:
-
ok,... i like to type my questions in, like using the index in MSDN. my question this time will be textcolor "like changing it from white to blue or somthing like that." I first jumped into MSDN to look up text color,... in Index mode there are three C++ things i can choose from. "I want to do everything using the win32 app console project... (just noting it :)) there is: 1. Visual C++ Documintation. 2. Visual C++, platform SDK, and win ce docs and 3. visual c++, platform SDK, and enterprise docs. first question is: What one should i select to get the results to my questions most relative? second question is: how do i now what help files will help me with my project "win32 con. app." so that i dont get them consfused with MFC n so n so? Third question is: How do you use the syntax that the help files give you? "there is a bunch of code that i do not know how to use... the help files just list the code and seem to hope you know hoe to apply it to you code" (I dont know how to apply it)(to make it work) :) Thanks for the help! ~SilverShalkin :rose:
COLORREF SetTextColor( COLORREF clr ); This is out of the MSDN help file... Supposely it sets the text color "that is exactly what i want to do) How do i use this line in my code "applying it"? And what header goes with it? is it "#include "afxcmn.h"" Thanks all ~SilverShalkin :rose:
-
COLORREF SetTextColor( COLORREF clr ); This is out of the MSDN help file... Supposely it sets the text color "that is exactly what i want to do) How do i use this line in my code "applying it"? And what header goes with it? is it "#include "afxcmn.h"" Thanks all ~SilverShalkin :rose:
This is mostly done in the OnCtlColor handler. For example:
BEGIN_MESSAGE_MAP(CDummyDlg, CDialog) ... ON_WM_CTLCOLOR() END_MESSAGE_MAP() HBRUSH CDummyDlg::OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor ) {HBRUSH hbr = CDialog::OnCtlColor(pDC,pWnd,nCtlColor); pDC->SetTextColor(RGB(255,0,0)); return hbr; }
This will tell every control in the dialog (who are kind enough to ask) to paint text red. Check nCtlColor if you want the color to go somewhere special. If you want another backcolor, this is also the place to go. Make the return value into the desired brush. /moliate -
ok,... i like to type my questions in, like using the index in MSDN. my question this time will be textcolor "like changing it from white to blue or somthing like that." I first jumped into MSDN to look up text color,... in Index mode there are three C++ things i can choose from. "I want to do everything using the win32 app console project... (just noting it :)) there is: 1. Visual C++ Documintation. 2. Visual C++, platform SDK, and win ce docs and 3. visual c++, platform SDK, and enterprise docs. first question is: What one should i select to get the results to my questions most relative? second question is: how do i now what help files will help me with my project "win32 con. app." so that i dont get them consfused with MFC n so n so? Third question is: How do you use the syntax that the help files give you? "there is a bunch of code that i do not know how to use... the help files just list the code and seem to hope you know hoe to apply it to you code" (I dont know how to apply it)(to make it work) :) Thanks for the help! ~SilverShalkin :rose:
The simple answer is that none of that stuff will let you change text colour in a console app. That's why Bill invented Windows! :)