代码如下:
void CMFCVLCDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
static RECT LastWindowRect = {0, 0, 0, 0};
CWnd *hWin;
int ux=cx-LastWindowRect.right;
int uy=cy-LastWindowRect.bottom;
if((hWin=GetDlgItem(IDC_DISPLAY))!=NULL)//使Display随窗口变化而变化
{
RECT rect;
hWin->GetWindowRect(&rect);
ScreenToClient(&rect);
rect.right+=ux;
rect.bottom+=uy;
hWin->MoveWindow(&rect);
}
LastWindowRect.right=cx;
LastWindowRect.bottom=cy;
}