Hello everybody,

I'm using the following code to change the background color of a listbox created in a dialog box under windows 98




.ELSEIF uMsg==WM_CTLCOLORLISTBOX

invoke GetSysColor,COLOR_MENU
mov dwColor,eax
invoke GetWindowDC,hListBox
mov hdc,eax
invoke SetBkColor,hdc,dwColor
invoke ReleaseDC,hListBox,hdc



The return values are all correct, no error messages, but nothing happens. The list box should turn gray. I'm puzzled over this and any suggestions would be much appreciated.

best regards,

czDrillard
Posted on 2003-05-09 01:02:46 by czDrillard
When you use the CTLCOLOR messages you have just to return a brush. For example

;Somewhere during init
invoke CreateSolidBrush,COLOR_MENU
mov hBrush,eax

.ELSEIF uMsg==WM_CTLCOLORLISTBOX
mov eax,hBrush
ret


I think I covered this in a thread called Device Context with msmith not too long ago Here's the thread
Posted on 2003-05-09 01:09:25 by donkey
Oops:o my apologies for asking a question which has already been answered.

Thanks donkey. next time I will search the board past messages more completely.

best regards,

czDrillard
Posted on 2003-05-09 09:06:36 by czDrillard