Thread: Window Color

  1. #1
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138

    Window Color

    How do u make the window have a background color other than the standard black, white, and gray? I think it has to do with regions, but I don't know how to get a color like yellow or something. Yes, I am a beginner and very dumb.

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Create and define an HBRUSH object (with CreateSolidBrush) then use it when you set up your WNDCLASSEX hbrBackground.

    Here's a basic example:
    Code:
    //this is all at the top of your WinMain
    HBRUSH hbYellow=CreateSolidBrush(RGB(255,255,0));
    WNDCLASSEX wcx;
    wcx.hbrBackground=hbYellow;
    //wcx.etc etc etc....

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Thanx, I'll check it out.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM