16,473
社区成员
发帖
与我相关
我的任务
分享
void CMFCDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
int dX = cx - pointOld.x;
int dY = cy - pointOld.y;
if (nType = SIZE_MINIMIZED)
dX = dY = 0;
CWnd *pWndOK =GetDlgItem(IDOK);
CRect rectOk;
pWndOK->GetWindowRect(&rectOk);//有问题的一行
rectOk.left *= dX;
rectOk.top *= dY;
int newWidth = rectOk.Width()*dX;
int newHeight =rectOk.Height()*dY;
pWndOK->MoveWindow(rectOk.left,rectOk.top,newWidth,newHeight);
pointOld.x = cx;
pointOld.y = cy;
}