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 » CFrame question Collapse All
Subject Author Date
tera tera Mar 18, 2009 - 12:33 AM

Hello.


 


 


MDI-Task  is not displayed by task bar when I take the following programs.

Please teach a cause.

http://ifreeta.dee.cc/20090318/MDI.LZH



 // create main MDI frame window

 if (!pFrame->LoadFrame(IDR_MAINFRAME))

  return FALSE;


 // try to load shared MDI menus and accelerator table

 //TODO: add additional member variables and load calls for

 // additional menu types your application may need.


 HINSTANCE hInst = AfxGetResourceHandle();

 m_hMDIMenu  = ::LoadMenu(hInst, MAKEINTRESOURCE(IDR_MDITYPE));

 m_hMDIAccel = ::LoadAccelerators(hInst, MAKEINTRESOURCE(IDR_MDITYPE));


 //----------------------------------------------

    pFrame->SetRedraw( FALSE );


 // Data reading processing

    int iRec;

    for ( iRec = 0 ; iRec < 20 ; iRec++ ){

     Sleep(100);

    }


    pFrame->SetRedraw( TRUE );


    pFrame->RedrawWindow(

         NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN|RDW_FRAME

    );

 pFrame->SetFocus();

 //----------------------------------------------


 // window placement persistence

 pFrame->ActivateFrame( m_nCmdShow );

Technical Support Mar 18, 2009 - 2:16 PM

This should be fixed in the CMDIApp::InitInstance() method. Just add the following two lines of code to the bottom of this method:

   ::SetActiveWindow( NULL );
            pFrame->SetActiveWindow();

Before the last line:
   return TRUE;