Microsoft KB Archive/198980

{|
 * width="100%"|

PRB: Problems with SetSysColors on SMP Systems

 * }

Q198980

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 4.0
 * the operating system: Microsoft Windows 2000

-

SYMPTOMS
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.

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 : kbOSWinNT400 kbOSWin2000 kbSDKWin32 kbSysSettings kbGrpDSUser kbWndwMsg

Issue type : kbprb

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch