PRB: Problems with SetSysColors on SMP Systems

ID: Q198980


The information in this article applies to:


SYMPTOMS

BETA INFORMATION BETA INFORMATION BETA INFORMATION

This article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about obtaining support for a Beta release, please see the documentation included with the Beta product files, or check the Web location from which you downloaded the release.

BETA INFORMATION BETA INFORMATION BETA INFORMATION


SetSysColors can cause inconsistent color changes on SMP systems if windows are repositioned, hidden, made visible, and/or resized immediately after this change.


CAUSE

Because SetSysColors sends a WM_SYSCOLORCHANGING message to all top-level windows, which must propagate it to lower-level children, it's possible for a thread with one processor affinity to send a size, position, or show message to a thread with another processor affinity and have it arrive before or after the WM_SYSCOLORCHANGING message. This can cause the window to miss the WM_SYSCOLORCHANGING message.


RESOLUTION

This behavior is a consequence of the designed behavior of Windows NT on SMP systems. Applications that make global changes to the system should make no other changes until there has been sufficient time for the original set of changes to take effect.

Using SendMessageTimeOut() and BroadcastSystemMessage() to make sure that messages have propagated through the system has been shown to make the problem less severe, but does not completely prevent it.


STATUS

This behavior is by design, because there is no guarantee of synchronicity or determinism in messages sent by different threads.

Applications that make global changes must ensure that such changes are synchronized.

Additional query words:


Keywords          : kbNTOS400 kbWinOS2000 kbSDKWin32 kbSysSettings kbGrpUser kbWndwMsg 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: April 30, 1999