Add Windows Message Handler,处理WM_ERASEBKND消息
BOOL CSDI_TESTView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
//设置brush为希望的背景颜色
CBrush backBrush(RGB(255, 128, 128));
//保存旧的brush
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rect;
pDC->GetClipBox(&rect);
//画需要的区域
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
//return CView::OnEraseBkgnd(pDC);
//必须去掉
}