Hi All, Got an App which consists of a single window which is a Dialog one, it has a Multiline Edit box used for displaying information.

I want the Editbox background to be black and the text in the box to be green, is this colour change possible? if so any code to support this?

Secondly, How would one mimic the look of a Multiline Edit box, using a window in the above situation?
Posted on 2001-09-29 11:35:10 by Enforcer

You should look at the RichEdit control.it does what you want.
It allows you to use predefined colors and many more things...
Iczelion did a tutorial on this subject and many examples are available on his site... http://www.win32asm.cjb.net
Posted on 2001-09-29 11:49:21 by JCP
Enforcer, in order to change edit box's colours, you must reply to the WM_CTLCOLOREDIT or WM_CTLCOLORSTATIC (if the edit box is read-only) message that is sent to the edit box's parent (your dialog).

.elseif [uMsg]==WM_CTLCOLOREDIT
invoke SetBkColor, [wParam], 00000000h
invoke SetTextColor, [wParam], 0000FF00h
invoke GetStockObject, BLACK_BRUSH

Change WM_CTLCOLOREDIT to WM_CTLCOLORSTATIC if your edit box is read-only. The hWnd of the control will be in lParam and its device context handle in wParam (used in the above code). Do not forget to include gdi32.inc and gdi32.lib in your application. For more information, consult with your API reference.

Posted on 2001-09-29 12:03:59 by comrade
Thanks Comrade, you got it right on target. I only added GetDlgItem to get the Controls handle,
and tested for eax==lParam now works perfect.
I appreciate your input Readiosys, although there was colour changing in the rich Edit tutorials, it was not what I was looking for in this instance.

Thanks for responding..!

Posted on 2001-09-29 17:06:09 by Enforcer