PRB: Problems with SetSysColors on SMP Systems (198980)
The information in this article applies to:
- Microsoft Platform Software Development Kit (SDK) 1.0, when used with:
- Microsoft Windows NT Server 4.0
- Microsoft Windows NT Workstation 4.0
- the operating system: Microsoft Windows 2000
This article was previously published under Q198980 SYMPTOMSThis 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 how to obtain support for a Beta release, see the documentation that is included with the Beta product files, or check the Web location from which you downloaded the release.
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.
Modification Type: | Minor | Last Reviewed: | 7/11/2005 |
---|
Keywords: | kbprb kbSysSettings KB198980 |
---|
|