WM_CTLCOLORxxx Message Changes for Windows 95

Last reviewed: September 29, 1995
Article ID: Q130952
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows 95 version 4.0
    

SUMMARY

In previous versions of Windows, an application could change the background, text, and/or text background colors of controls by performing certain actions in response to WM_CTLCOLORxxx messages.

However, in Windows 95, the messages sent by different types of controls are somewhat different.

MORE INFORMATION

The following list outlines the changes in WM_CTLCOLORxxx messages sent by standard controls in Windows 95:

WM_CTLCOLORBTN

Sent By: command buttons (regular and default)

Changes made during this message have no effect on command buttons. Command buttons always use system colors for drawing themselves.

WM_CTLCOLORSTATIC

Sent By: Any control that displays text which would be displayed using the default dialog/window background color. This includes check boxes, radio buttons, group boxes, static text, read-only or disabled edit controls, and disabled combo boxes (all styles).

The changes affect the text drawn in the control. Changes do not affect the checkmarks on the buttons or the outline of the group box.

WM_CTLCOLOREDIT

Sent By: Enabled, non-read-only edit controls and enabled combo boxes (all styles)

The changes affect the background, text, and text background of these controls. For combo boxes, the changes made in this message affect only the "edit" portion of the control. The list portion is affected by the WM_CTLCOLORLISTBOX message.

In previous versions of Windows, radio buttons, check boxes and group boxes would send WM_CTLCOLORBTN messages and paint themselves accordingly. In Windows 95, these controls send WM_CTLCOLORSTATIC messages instead.

These changes were implemented to make changing the appearance of controls more logical (text on the dialog background is now classified as "static").


Additional reference words: 4.00
KBCategory: kbui
KBSubcategory: UsrCtl



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: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.