WM_CTLCOLORLISTBOX
This message is sent to the parent window of a list box before Windows draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle.
WM_CTLCOLORLISTBOX hdcLB = (HDC) wParam;
hwndLB = (HWND) lParam;
Parameters
- hdcLB
Handle to the device context for the list box - hwndLB
Handle to the list box
Return Values
If an application processes this message, it must return a handle to a brush. The system uses the brush to paint the background of the list box.
- Default Action
The DefWindowProc function selects the default system colors for the list box.
Remarks
The system does not automatically destroy the returned brush. It is the application's responsibility to destroy the brush when it is no longer needed.
The WM_CTLCOLORLISTBOX message is never sent between threads. It is sent only within one 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.
Requirements
| Runs on | Versions | Defined in | Include | Link to |
|---|---|---|---|---|
| Windows CE OS | 2.0 and later | Winuser.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
DefWindowProc, RealizePalette, SelectPalette, WM_CTLCOLORBTN, WM_CTLCOLORDLG, WM_CTLCOLOREDIT, WM_CTLCOLORSCROLLBAR, WM_CTLCOLORSTATIC
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.