learn,no end

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

代码如下:                                                                                                                                 

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;
}

posted on 2009-12-09 17:37  知足长乐  阅读(369)  评论(0编辑  收藏  举报