void CTestDlg::OnPaint()
{
if(IsIconic())
{
......
}
else
{
CPaintDC dc(this);
CRect rect;
GetWindowRect(&rect);
CDC memDC;
CBitmap cBitmap;
CBitmap* pOldMemBmp=NULL;
cBitmap.LoadBitmap(IDB_BITMAP);
memDC.CreateCompatibleDC(&dc);
pOldMemBmp=memDC.SelectObject(&memBmp);
dc.BitBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,SRCCOPY);
memDC.SelectObject(pOldMemBmp);
CDialog::OnPaint();
}
}