I'm a bit of a newbie to all this Win32 programming stuff, having most
of my experience in DOS.
I'm using CreateWindow("EDIT" .... to create a multiline edit control
but I can't seem to be able to specify (or even to change) it's colour.
Can anyone help?
Steve
P.S. Please could you CC this to my email as I can't access the NGs in
college!
If you are creating controls in a dialog, you have to handle the
WM_CTLCOLOR messages
to change their colors.
For edit controls this will be WM_CTLCOLOREDIT.
In the dialog box procedure of the edit control parent use something like:
static HBRUSH hEditBrush;
case WM_INITDIALOG:
hEditBrush = CreateSolidBrush(RGB(0, 0, 128));
....
......
case WM_CTLCOLOREDIT:
SelectObject((HDC)wParam, (HGDIOBJ)hEditBrush);
return (BOOL)hEditBrush;
case WM_DESTROY:
DeleteObject(hEditBrush);
Note that you have the responsibility for creating AND deleting the
hEditBrush object.
It can be declared as a local static in the dialog box procedure, on
WM_INITDIALOG, create the brush,
and on WM_DESTROY delete the brush.
Jogy
noone wrote:
P.S. Is no...@noone.com your e-mail address ???
No, it is not, as I suspected. The mail returned .
So, please, give real e-mail address if you want something sent to you.
Jogy