INF: Control Panel Doesn't Respond to WM_WININICHANGE Messages

ID Number: Q68360

3.00

WINDOWS

Summary:

The Control Panel application does not respond to WM_WININICHANGE

messages under Windows version 3.0. Microsoft considered including

this functionality; however, it was decided that, because the Control

Panel changes various items in the system configuration file

(WIN.INI), responding to a WM_WININICHANGE message could cause a

conflict. (For example, if another application changes the text color

while the Control Panel has its color dialog displayed, what is the

proper action for the Control Panel?)

To work around this potential problem, the Control Panel reinitializes

itself each time a new dialog box is displayed. However, this

initialization does not involve querying the WIN.INI file with

GetProfileString().

More Information:

Windows caches the WIN.INI file. Therefore, if a regular text editor

(other than Notepad) is used to modify the file, the disk file is

updated, however, the cache is not.

When a WM_WININICHANGE message is broadcast to all top-level windows,

each application can check the WIN.INI cache for relevant changes.

However, applications will not look at the WIN.INI file on disk.

One way to update the cache is to exit Windows and restart. Another

way to update the cache is to call WriteProfileString(NULL,NULL,NULL),

which forces a flush of the cache. A subsequent call to

GetProfileString() will cause the WIN.INI file on disk to be read into

the cache.

However, the changes will not be reflected by the Control Panel unless

the user exits and re-enters Windows. Reflecting changes to WIN.INI in

the Control Panel without first exiting Windows is under consideration

for inclusion in a future release of Windows.