[Dev-C++] Edit control problem (WIN32)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <mr...@c2...> - 2003-02-08 15:22:15
|
Hi,
I am facing a strange problem with an edit control that I use
as a status window.
The control is created with this call to CreateWindow:
(line breaks may be garbled by the mailer..)
CreateWindow("edit", "",
WS_CHILD | WS_DLGFRAME | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE |
ES_READONLY, 10, 25, 470, 160, hwnd,
(HMENU) ID_STATUS, hProgInst, NULL);
I catch the WM_CTLCOLORSTATIC message like this:
case WM_CTLCOLORSTATIC:
{
if(GetDlgCtrlID((HWND)lParam) =3D=3D ID_STATUS)
{
SetBkMode((HDC)wParam, TRANSPARENT);
SetTextColor((HDC)wParam, RGB(50, 50, 150));
return (LRESULT)GetStockObject(LTGRAY_BRUSH);
}
}break;
This gives me blue text on a lightgray background in the control.
Now comes the problem: If the text in the edit control is large
enough that the user needs to move the scrollbar to see the text, the
text becomes garbled, ie the edit control does not repaint it's
window correctly.
If, however, I don't change the color of the control (by not catching
the WM_CTLCOLORSTATIC message), everything is fine, and the control
repaints just fine when scrolling.
What am I missing here?
-=D8yvind
--
____________________________________________
=D8yvind Kaurstad, Granittveien 51, 4340 Bryne
Tlf: 51 48 87 17, Mob: 990 86 990
Email: mr...@c2... ICQ#28366979
|