void CRestrictRectDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rect;
GetWindowRect(&rect);//获取窗口矩形区
if(cx > 400)
rect.right = rect.left + 400;//窗体宽度不能大于400
if(cy > 300)
rect.bottom = rect.top + 300;//窗体高度不能大于300
if(cx < 200)
rect.right = rect.left + 200;//窗体宽度不能小于200
if(cy < 150)
rect.bottom = rect.top + 150;//窗体高度不能小于150
MoveWindow(&rect);//修改窗体大小
}