Microsoft 开发人员网络 > 论坛主页 > Visual C++ General > Resizing a MDI child window programatically in maximized state
提出问题提出问题
 

已答复Resizing a MDI child window programatically in maximized state

  • 2009年11月4日 14:52Sajan Emmanuel 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Dear all,
    I have a MFC MDI application in VS 2003. In one of my view classes, I am embedding an OCX control. I just need to provide an option to resize the view class(CView derived).  I tried the below code.
    CRect rectClient;   
            GetClientRect(&rectClient);
            CRect r(0, 0, m_XVideoOCXCtrl.XGetWidth(), m_XVideoOCXCtrl.XGetHeight());
            GetParentFrame()->SetWindowPos(NULL, 0, 0,  r.Width() + CAM_DOUBLEBORDER, r.Height() + CAM_DOUBLEBORDER, SWP_SHOWWINDOW);
    GetParentFrame()->ShowWindow(SW_SHOW);

    This is working fine when my view(MDI Child window) class is not in the maximized state. But when i try to execute the same code in the maximized state, the view class is scaled to the correct size, but I am missing the control box of the window. Can any body tell, how can re size the MDI Child window perfectly in maximized state.

答案

全部回复