windows_programming_notes.nbk: Home | Index | Next Page: WM_CUT | Previous Page: WM_CTLCOLORSCROLLBAR


 WM_CTLCOLORSTATIC

A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control.

A window receives this message through its WindowProc function.

Parameters

Return Value

If an application processes this message, the return value is a handle to a brush that the system uses to paint the background of the static control.

Remarks

By default, the DefWindowProc function selects the default system colors for the static control.

Edit controls that are not read-only or disabled do not send the WM_CTLCOLORSTATIC message; instead, they send the WM_CTLCOLOREDIT message.

The WM_CTLCOLORSTATIC message is never sent between threads; it is sent only within the same thread.

If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.

Notification Requirements


windows_programming_notes.nbk: Home | Index | Next Page: WM_CUT | Previous Page: WM_CTLCOLORSCROLLBAR


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time