INF: Changing Window Colors with Control Panel

ID Number: Q11246

1.x 2.00 2.03 2.10 3.00

WINDOWS

Summary:

In Windows, changing the screen background color or the test color

will affect the following programs:

Notepad MS-DOS Executive

Clock PIF Editor

Control Spooler Panel

Calendar Terminal

Clipboard Write

However, the following programs are not affected:

Calculator Reversi

Cardfile COMMAND.COM

Paint

More Information:

It is up to the application to look in the WIN.INI file to see what

[color] preferences are selected. Some applications do not change

because either they do not look in the WIN.INI file for those colors,

or the applications choose to ignore them.

For an application to be aware of system color changes, the

WM_SYSCOLORCHANGE message must be used in the Windows procedures.

For example, suppose a static hBrush is in the WndProc for repaint

purposes. To be aware of system color changes, update the brush based

on system color changes by doing something similar to the following:

case WM_SYSCOLORCHANGE:

DeleteObject(hBrush);

hBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));

return 0;