void CXXXDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rectDlg;
CPaintDC dc(this);
GetClIEntRect(rectDlg);
CRect rectBar;
//工具欄
CToolBar *m_pwndToolBar = (CToolBar *)AfxGetApp()->m_pMainWnd->
GetDescendantWindoW(AFX_IDW_TOOLBAR);
m_pwndToolBar->GetClIEntRect(&rectBar);
//如果不加4,經過若干次最窗口改變大小,則工具欄被完全覆蓋
m_pwndToolBar->MoveWindow(0,0,rectDlg.Width(),rectBar.Height()+4);
//狀態欄
CStatusBar *m_pwndStatusBar = (CStatusBar *)AfxGetApp()->m_pMainWnd->
GetDescendantWindow(AFX_IDW_STATUS_BAR);
m_pwndStatusBar->GetClIEntRect(&rectBar);
m_pwndStatusBar->MoveWindow(0,cy-rectBar.Height(),rectDlg.Width(),rectBar.Height());
// 繪制對話框背景色
dc.FillSolidRect(rectDlg,RGB(255,255,255)); //設置為白色
}