15,980
社区成员




void CMainFrame::OnPaint()
{
//CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CMDIFrameWndEx::OnPaint() for painting messages
CMDIFrameWnd::OnPaint();
CRect rc;
CDC dc;
dc.m_hDC = ::GetDC(this->m_hWndMDIClient);
CBrush br(RGB(100, 0, 100) );
dc.SelectObject(&br);
this->GetClientRect(&rc);
dc.PatBlt(rc.left,rc.top,rc.Width(),rc.Height(),PATCOPY);
ReleaseDC(&dc);
}
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if( (pMsg->hwnd == m_hWndMDIClient) && (pMsg->message == WM_PAINT) )
PostMessage(WM_PAINT);
return CMDIFrameWndEx::PreTranslateMessage(pMsg);
}
BOOL CMainFrame::OnEraseMDIClientBackground( CDC *pDC )
{
//CMDIFrameWnd::OnPaint();
CRect rc;
CDC dc;
dc.m_hDC = ::GetDC(this->m_hWndMDIClient);
CBrush br(RGB(100, 0, 100) );
dc.SelectObject(&br);
this->GetClientRect(&rc);
dc.PatBlt(rc.left,rc.top,rc.Width(),rc.Height(),PATCOPY);
ReleaseDC(&dc);
return TRUE;
}