Microsoft Developer Network > Página Inicial dos Fóruns > Visual C++ General > Resizing a MDI child window programatically in maximized state
Fazer uma PerguntaFazer uma Pergunta
 

RespondidoResizing a MDI child window programatically in maximized state

  • quarta-feira, 4 de novembro de 2009 14:52Sajan Emmanuel Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.

    • EditadoSajan Emmanuel quarta-feira, 4 de novembro de 2009 17:14Corrected spelling
    •  

Respostas

Todas as Respostas