Monday 28 November 2011

What are the system color constants? in C programming

What are the system color constants?

he system color constants are used by Windows to control the colors of various objects included in the Windows environment. Table XXI.25 lists the system color constants (as defined in windows.h).

The system color constants.
----------------------------------------------------------------------------------------------------------
Color Constant                                   Target Object
---------------------------------------------------------------------------------------------------------
COLOR_SCROLLBAR                     Scrollbar
COLOR_BACKGROUND               Windows desktop
COLOR_ACTIVECAPTION            Active title
COLOR_INACTIVECAPTION        Inactive title
COLOR_MENU                                Menu bar
COLOR_WINDOW                          Window
COLOR_WINDOWFRAME             Window frame
COLOR_MENUTEXT                       Menu text
COLOR_WINDOWTEXT                 Window text
COLOR_CAPTIONTEXT                  Title text
COLOR_ACTIVEBORDER               Active border
COLOR_INACTIVEBORDER           Inactive border
COLOR_APPWORKSPACE             Application workspace
COLOR_HIGHLIGHT                        Highlight
COLOR_HIGHLIGHTTEXT              Highlight text
COLOR_BTNFACE                           Button face
COLOR_BTNSHADOW                    Button shadow
COLOR_GRAYTEXT                        Grayed-out text
COLOR_BTNTEXT                           Button text
------------------------------------------------------------------------------------------------------------

You can change the system colors from within your Windows programs by calling the GetSysColor() and SetSysColor() functions. You can also set these colors by altering the [colors] section of your WIN.INI (Windows initialization) file, or you can interactively set them by using the Windows control panel.

Cross Reference:

XXI.24: How do you access the system colors in a Windows program?

No comments:

Post a Comment