Getting a Window Color...

This is a discussion on Getting a Window Color... within the Windows Programming forums, part of the Platform Specific Boards category; In a Window Class, you can specify a backgrond color like "COLOR_WINDOW", how do I get the COLLOREF of these ...

  1. #1
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Lightbulb Getting a Window Color...

    In a Window Class, you can specify a backgrond color like "COLOR_WINDOW", how do I get the COLLOREF of these colors? (There MUST be a function!)

    SPH

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,855
    Try,

    COLORREF GetBkColor(HDC)

    or one of its related group.

  3. #3
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Cool yeah tried it

    doesnt return the background color of the window... just the text background (its prupose).

    SPH

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,855
    If you are creating a window class
    try setting the bkgn with

    WndClass.hbrBackground =GetStockObject(GREY_BRUSH);

    or

    COLORREF=GetPixel(HDC,x,y);

    or even

    GetSysColor()
    Last edited by novacain; 09-04-2001 at 02:01 AM.

  5. #5
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Talking lolz

    Please... read the q . I am trying to retrive a window class, and trying to get the COLOREF of the background...

    SPH

  6. #6
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,855
    OK.
    If you registered the class use,

    GetClassInfoEx()

    and look at the background member. This is a brush not a COLOURREF. But by using the previous functions you should be able to draw with the brush and pull out the color.

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, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21