Using MSDN....
-
Ok,... I would rather use the help files that C++ comes with rather than ask you guys all the time. "no offence" There are good reasons for this, 1. dont have to bother you with stupid questions i can first find out on my own. 2. It would just be more helpfull for me :) ok... i wanted to change the color of the background using win32 console app. the file said... "exactly :)" --------------------------------------------------- CDC::SetBkColor virtual COLORREF SetBkColor( COLORREF crColor ); Return Value The previous background color as an RGB color value. If an error occurs, the return value is 0x80000000. Parameters crColor Specifies the new background color. Remarks Sets the current background color to the specified color. If the background mode is OPAQUE, the system uses the background color to fill the gaps in styled lines, the gaps between hatched lines in brushes, and the background in character cells. The system also uses the background color when converting bitmaps between color and monochrome device contexts. If the device cannot display the specified color, the system sets the background color to the nearest physical color. CDC Overview | Class Members | Hierarchy Chart See Also CDC::BitBlt, CDC::GetBkColor, CDC::GetBkMode, CDC::SetBkMode, CDC::StretchBlt,::SetBkColor --------------------------------------------------------------- Now,... how do i use the info that this help file tells me, for that i can do what i want to do in my program? "that is, change the color to white, or blue" How do i read this and use it? Thanks All! ~SilverShalkin :rose:
-
Ok,... I would rather use the help files that C++ comes with rather than ask you guys all the time. "no offence" There are good reasons for this, 1. dont have to bother you with stupid questions i can first find out on my own. 2. It would just be more helpfull for me :) ok... i wanted to change the color of the background using win32 console app. the file said... "exactly :)" --------------------------------------------------- CDC::SetBkColor virtual COLORREF SetBkColor( COLORREF crColor ); Return Value The previous background color as an RGB color value. If an error occurs, the return value is 0x80000000. Parameters crColor Specifies the new background color. Remarks Sets the current background color to the specified color. If the background mode is OPAQUE, the system uses the background color to fill the gaps in styled lines, the gaps between hatched lines in brushes, and the background in character cells. The system also uses the background color when converting bitmaps between color and monochrome device contexts. If the device cannot display the specified color, the system sets the background color to the nearest physical color. CDC Overview | Class Members | Hierarchy Chart See Also CDC::BitBlt, CDC::GetBkColor, CDC::GetBkMode, CDC::SetBkMode, CDC::StretchBlt,::SetBkColor --------------------------------------------------------------- Now,... how do i use the info that this help file tells me, for that i can do what i want to do in my program? "that is, change the color to white, or blue" How do i read this and use it? Thanks All! ~SilverShalkin :rose:
SetBkColor is not related to the console. It looks like you looked up a function from MFC, and MFC is only useful for developing windows applications. SilverShalkin wrote: How do i read this and use it? If you were using MFC, you would create a CDC object. Then you would be able to call the member function of CDC called SetBKColor. One more thing to note, is that a COLORREF can be created with the RGB() macro, were you provide the RGB color combinations to create a new color. If you wanted to set the background color to red, you would do this: void DoSomething (CDC *dc) { dc->SetBkColor(RGB(255,0,0)); ... } I am sorry I do not know console programming well enough to tell you how to change the background color.
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life! -
Ok,... I would rather use the help files that C++ comes with rather than ask you guys all the time. "no offence" There are good reasons for this, 1. dont have to bother you with stupid questions i can first find out on my own. 2. It would just be more helpfull for me :) ok... i wanted to change the color of the background using win32 console app. the file said... "exactly :)" --------------------------------------------------- CDC::SetBkColor virtual COLORREF SetBkColor( COLORREF crColor ); Return Value The previous background color as an RGB color value. If an error occurs, the return value is 0x80000000. Parameters crColor Specifies the new background color. Remarks Sets the current background color to the specified color. If the background mode is OPAQUE, the system uses the background color to fill the gaps in styled lines, the gaps between hatched lines in brushes, and the background in character cells. The system also uses the background color when converting bitmaps between color and monochrome device contexts. If the device cannot display the specified color, the system sets the background color to the nearest physical color. CDC Overview | Class Members | Hierarchy Chart See Also CDC::BitBlt, CDC::GetBkColor, CDC::GetBkMode, CDC::SetBkMode, CDC::StretchBlt,::SetBkColor --------------------------------------------------------------- Now,... how do i use the info that this help file tells me, for that i can do what i want to do in my program? "that is, change the color to white, or blue" How do i read this and use it? Thanks All! ~SilverShalkin :rose:
SilverShalkin wrote: i wanted to change the color of the background using win32 console app. [...] CDC::SetBkColor This is a GDI functions that has nothing to do with console I/O. Have a look at
SetConsoleTextAttribute
. -
SilverShalkin wrote: i wanted to change the color of the background using win32 console app. [...] CDC::SetBkColor This is a GDI functions that has nothing to do with console I/O. Have a look at
SetConsoleTextAttribute
.Ok... my mistake... "that makes things a little bit easier to understand :) How do i find files only on Win32 console App.'s that i can use to program? and how do i know wether it is a mfc or win32? Thanks! ~SilverShalkin :rose:
-
Ok... my mistake... "that makes things a little bit easier to understand :) How do i find files only on Win32 console App.'s that i can use to program? and how do i know wether it is a mfc or win32? Thanks! ~SilverShalkin :rose:
You browse the "outline" of the "books". The window to the left tells you where you are and what "book" you are reading. The path element "Platform SDK" should be obvious. From that one you drill down to "Windows Base Services" and somewhere under that you find this functions. I really hope there's no way in h*ll the POS MFC manages to creep into the SDK also. :-)