Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » MDI Problems - Loose Caption after "Maximize" and "Restore" with 2 Windows Collapse All
Subject Author Date
Filippo Murroni Jun 23, 2008 - 11:15 AM

I have a serious problem with MDI windows. I have found where is yhe problem, but I don’t Know how solve it...


Description:


   - 2 MDI child actived


   - Window Rect of child "2" inside  Window Rect of child "1" ( width 2 < width 1 and height 2 < height 1 )


   - Focus on Win 2


   - Click on maximize button in the caption of Win 1


   - Win 1 restore


   - Move of Win 1 to see win 2


   - WIN 2 WITHOUT CAPTION !!!


The program works fine if I insert a Message Box,  like in code below :


void FAmsg_pump()

{

 MSG toPeek;

 while ( ::PeekMessage( &toPeek, NULL, 0, 0, PM_NOREMOVE ) ){

        if ( !AfxGetApp()->PumpMessage( ) ){

            break;

        }

    }


}




void CChildFrame::OnSysCommand(UINT nID, LPARAM lParam)

{

 CMainFrame* tMf=(CMainFrame*)AfxGetMainWnd();

 

 if(nID==SC_MAXIMIZE)  

 {

  if(tMf->MDIGetActive(NULL)!=this){


   AfxMessageBox("Here something happens..");

   CExtNCW < CMDIChildWnd>::MDIActivate();

   FAmsg_pump();

  }

 }


 CExtNCW < CMDIChildWnd>::OnSysCommand(nID, lParam);

}


Can you help me, please!!!


Thanks a lot...

Filippo Murroni Jun 25, 2008 - 1:04 AM

It’s possible to reproduce this problem using the sample "MDI_600", using  CExtNCW < CMDIChildWnd> for the class "CChildFrame" and not only CMDIChildWnd !!!


We have found a solution using :


void CChildFrame::OnLButtonDown(UINT nFlags, CPoint point)

{

 

 CWnd * pWndFrameImpl = (CWnd *)NcFrameImpl_GetFrameWindow();

 CRect rcWnd;

 pWndFrameImpl->GetWindowRect( &rcWnd );

 CPoint pointWnd;

 ::GetCursorPos( &pointWnd );

 pointWnd -= rcWnd.TopLeft();

 if( m_rcNcFrameImpl_ScClose.PtInRect( pointWnd ) ){

  m_nNcFrameImpl_ScTrackedButtonPressed = SC_CLOSE;

  CExtNCW < CMDIChildWnd>::MDIActivate();

 }else if( m_rcNcFrameImpl_ScMaximize.PtInRect( pointWnd ) ){

  m_nNcFrameImpl_ScTrackedButtonPressed = SC_MAXIMIZE;

  CExtNCW < CMDIChildWnd>::MDIActivate();

 }else if( m_rcNcFrameImpl_ScMinimize.PtInRect( pointWnd ) ){

  m_nNcFrameImpl_ScTrackedButtonPressed = SC_MINIMIZE;

  CExtNCW < CMDIChildWnd>::MDIActivate();

 }


 CMDIChildWnd::OnLButtonDown(nFlags, point);

}

Technical Support Jun 24, 2008 - 4:33 AM

We tried to reproduce this problem using one our samples like DRAWCLI, MDI and MDIDOCVIEW but failed. Could you help us reproduce this problem? We believe it may have to do with specially handled messages of MDI interface in scope of your project.