2 * Support for system colors
4 * Copyright David W. Metcalfe, 1993
5 * Copyright Alexandre Julliard, 1994
9 static char Copyright
[] = "Copyright David W. Metcalfe, 1993";
10 static char Copyright2
[] = "Copyright Alexandre Julliard, 1994";
17 static char * DefSysColors
[] =
19 "Scrollbar", "224 224 224", /* COLOR_SCROLLBAR */
20 "Background", "192 192 192", /* COLOR_BACKGROUND */
21 "ActiveTitle", "0 64 128", /* COLOR_ACTIVECAPTION */
22 "InactiveTitle", "255 255 255", /* COLOR_INACTIVECAPTION */
23 "Menu", "0 255 255", /* COLOR_MENU */
24 "Window", "255 255 255", /* COLOR_WINDOW */
25 "WindowFrame", "0 0 0", /* COLOR_WINDOWFRAME */
26 "MenuText", "0 0 0", /* COLOR_MENUTEXT */
27 "WindowText", "0 0 0", /* COLOR_WINDOWTEXT */
28 "TitleText", "255 255 255", /* COLOR_CAPTIONTEXT */
29 "ActiveBorder", "128 128 128", /* COLOR_ACTIVEBORDER */
30 "InactiveBorder", "255 255 255", /* COLOR_INACTIVEBORDER */
31 "AppWorkspace", "255 255 232", /* COLOR_APPWORKSPACE */
32 "Hilight", "166 202 240", /* COLOR_HIGHLIGHT */
33 "HilightText", "0 0 0", /* COLOR_HIGHLIGHTTEXT */
34 "ButtonFace", "192 192 192", /* COLOR_BTNFACE */
35 "ButtonShadow", "128 128 128", /* COLOR_BTNSHADOW */
36 "GrayText", "192 192 192", /* COLOR_GRAYTEXT */
37 "ButtonText", "0 0 0", /* COLOR_BTNTEXT */
38 "InactiveTitleText", "0 0 0", /* COLOR_INACTIVECAPTIONTEXT */
39 "ButtonHilight", "255 255 255" /* COLOR_BTNHIGHLIGHT */
42 #define NUM_SYS_COLORS (COLOR_BTNHIGHLIGHT+1)
44 static COLORREF SysColors
[NUM_SYS_COLORS
];
47 /*************************************************************************
56 for (i
= 0, p
= DefSysColors
; i
< NUM_SYS_COLORS
; i
++, p
+= 2)
58 GetProfileString( "colors", p
[0], p
[1], buffer
, 100 );
59 if (!sscanf( buffer
, " %d %d %d", &r
, &g
, &b
)) r
= g
= b
= 0;
60 SysColors
[i
] = RGB( r
, g
, b
);
65 /*************************************************************************
66 * GetSysColor (USER.180)
69 COLORREF
GetSysColor(short nIndex
)
72 printf("System Color %d = %6x\n", nIndex
, SysColors
[nIndex
]);
74 return SysColors
[nIndex
];
78 /*************************************************************************
79 * SetSysColors (USER.181)
82 void SetSysColors(int nChanges
, LPINT lpSysColor
, COLORREF
*lpColorValues
)
86 for (i
= 0; i
< nChanges
; i
++)
88 SysColors
[lpSysColor
[i
]] = lpColorValues
[i
];
91 /* Send WM_SYSCOLORCHANGE message to all windows */
93 /* ................ */
95 /* Repaint affected portions of all visible windows */
97 /* ................ */