Results 1 to 2 of 2

Thread: Determining System Palette Entries for 3D Objects

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    2
    Is it possible to extract the RGB values for the DYNAMIC color entries that windows assigns to its 3D objects?

    My goal is to draw 3D objects (say a raised button for instance), but if I use "hard-coded" colors, such as the RGB values for Lt. Grey, Grey, and Dk. Grey, then when the user goes into the display properties and changes his color scheme to say TEAL, then my 3D objects will still remain in the gray tones, which would look corny on a teal background. I know VB uses color constants such as vb3DFace, vb3DShadow, vb3DHighlight, etc. that can be used with its STANDARD supplied controls, however if you try to use these values directly with the FillRect() function, the color is not recognized and is drawn pure black.

    I also tried to enumerate the entries in the system palette using GetSystemPaletteEntries() to create an identity palette, but none of these entries are dynamic.

    If anyone has any suggestions on what steps need to be taken, I would be very appreciative!

    --Lewis

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    2

    Problem Solution

    After a bit of research I found the answer:

    Declare Function GetSysColor Lib "user32" (ByVal nIndex As ColConst) As Long

    'Color constants for GetSysColor
    Public Enum ColConst
    COLOR_ACTIVEBORDER = 10
    COLOR_ACTIVECAPTION = 2
    COLOR_ADJ_MAX = 100
    COLOR_ADJ_MIN = -100
    COLOR_APPWORKSPACE = 12
    COLOR_BACKGROUND = 1
    COLOR_BTNFACE = 15
    COLOR_BTNHIGHLIGHT = 20
    COLOR_BTNSHADOW = 16
    COLOR_BTNTEXT = 18
    COLOR_CAPTIONTEXT = 9
    COLOR_GRAYTEXT = 17
    COLOR_HIGHLIGHT = 13
    COLOR_HIGHLIGHTTEXT = 14
    COLOR_INACTIVEBORDER = 11
    COLOR_INACTIVECAPTION = 3
    COLOR_INACTIVECAPTIONTEXT = 19
    COLOR_MENU = 4
    COLOR_MENUTEXT = 7
    COLOR_SCROLLBAR = 0
    COLOR_WINDOW = 5
    COLOR_WINDOWFRAME = 6
    COLOR_WINDOWTEXT = 8
    End Enum


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width