Control Panel Doesn't Respond to WM_WININICHANGE Messages

Last reviewed: July 22, 1997
Article ID: Q68360
3.00 3.10 WINDOWS kbprg

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.0 and 3.1

SUMMARY

The Control Panel application does not respond to WM_WININICHANGE messages under Windows. 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.


Additional reference words: 3.00 3.10
KBCategory: kbprg
KBSubcategory: UsrIni
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.