ShowWindow(SW_HIDE); CRect dlgRect; GetClientRect(&dlgRect); CPoint centerPoint; centerPoint.x = dlgRect.Width()/2; centerPoint.y = dlgRect.Height(); CRgn testrgn; this->ShowWindow(SW_HIDE); int m = GetSystemMetrics(SM_CYSIZEFRAME); this->MoveWindow(200,200,600,300); for (int i = 10; i < dlgRect.Width()/2*m; i+=1) { testrgn.CreateRectRgn(centerPoint.x-i,centerPoint.y-i,centerPoint.x + i,centerPoint.y + i); SetWindowRgn((HRGN)testrgn,TRUE); ShowWindow(SW_SHOW); CenterWindow(); testrgn.DeleteObject(); }