Programming |  Windows Programming |  Button Color Messages

Button Color Messages

The system provides default color values for buttons. An application can retrieve the default values for these colors by calling the GetSysColor function, or set the values by calling the SetSysColors function. The following table shows the default button-color values.

Value Element colored

However, calling SetSysColors affects all applications, so you should not call this function to customize buttons for your application.

The system sends a WM_CTLCOLORBTN message to a button's parent window before drawing a button. This message contains a handle to the button's device context and a handle to the child window. The parent window can use these handles to change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing the message.