Quote:
Originally Posted by shabbir
Define a CBrush pointer in your dialog Class
Code:
CBrush *brush;
Initialize the brush pointer in the constructor of your Dialog
Code:
brush = new CBrush(RGB(49,49,49));
Add the WM_CTLCOLR Message handler for the dialog and add the following code
Code:
	switch (nCtlColor) {
 
 	case CTLCOLOR_EDIT:
 		pDC->SetTextColor(RGB(0, 255, 0));
 		pDC->SetBkColor(RGB(0, 0, 0));
 		return (HBRUSH)(brush->GetSafeHandle());
 	default:
 		return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
 	}


Fine piece of code , very simple yet powerful.