Quote:
> I have a CEdit-derived control where I post messages from the server I am
> monitoring. I can change the color of the messages but it is for all
> messages
U should use ON_WM_CTLCOLOR
HBRUSH CNameView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr;
CBrush m_brush;
m_brush.CreateSolidBrush(RGB(0,0,0));
switch (nCtlColor)
{
case CTLCOLOR_EDIT:
case CTLCOLOR_MSGBOX:
switch (pWnd->GetDlgCtrlID())
{
case IDC_EDIT1:
pDC->SetBkColor(RGB(192,192,192));
pDC->SetTextColor(RGB(255,0,0));
hbr = (HBRUSH) m_brush;
break;
default:
hbr=CDialog::OnCtlColor(pDC,pWnd,nCtlColor);
break;
}
break;
default:hbr=CDialog::OnCtlColor(pDC,pWnd,nCtlColor);
}
return hbr;
Quote:
}