Hello everybody,
I'm using the following code to change the background color of a listbox created in a dialog box under windows 98
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
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
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
;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
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
Thanks donkey. next time I will search the board past messages more completely.
best regards,
czDrillard