Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Using MSDN....

Using MSDN....

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SilverShalkin
    wrote on last edited by
    #1

    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:

    P M 2 Replies Last reply
    0
    • S SilverShalkin

      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:

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      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!

      1 Reply Last reply
      0
      • S SilverShalkin

        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:

        M Offline
        M Offline
        Mike Nordell
        wrote on last edited by
        #3

        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.

        S 1 Reply Last reply
        0
        • M Mike Nordell

          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.

          S Offline
          S Offline
          SilverShalkin
          wrote on last edited by
          #4

          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:

          M 1 Reply Last reply
          0
          • S SilverShalkin

            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:

            M Offline
            M Offline
            Mike Nordell
            wrote on last edited by
            #5

            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. :-)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups