CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: MDICHILDWINDOW

  1. #1
    Guest

    MDICHILDWINDOW

    hai
    i have to MDICHILD WINDOWS..........
    how i can make my previous childwindow maximum when i close the active childwnd....
    i removed the WS_OVERLAPPED WINDOW property of previous childwindow.

    Suchitra...........





  2. #2
    Join Date
    May 1999
    Posts
    318

    Re: MDICHILDWINDOW


    Try this (i don't test it) :


    WINDOWPLACEMENT pl;
    child.GetWindowPlacement(&pl)
    pl.flags=WPF_RESTORETOMAXIMIZED;
    pl.showCmd=SW_SHOWMAXIMIZED;
    child.SetWindowPlacement(&pl)




    Hop this works.




  3. #3
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: MDICHILDWINDOW

    There is no need to remove WS_OVERLAPPEDWINDOW. Should all child frames be maximised? I can't see why you would only want one to be maximised. To create them maximised, override CChildFrame's PreCreateWindow() and add:

    cs.style |= WS_MAXIMIZE

    They will always fill the maximum space when they are created, then.

    Does this help?


    --
    Jason Teagle
    [email protected]

  4. #4
    Guest

    Re: MDICHILDWINDOW

    Hello Jason Teagle,

    Thank you for your response. Intially i want to show my application as SDI even though it is an MDI.SO,
    I remove, ws_overlappedwindow...as to said i done the case thing but it give me a result.........

    Suchitra.



  5. #5
    Guest

    Re: MDICHILDWINDOW

    Hai eric33,
    Thank you for your response.....but i wan to know where to paste that code which you suggest....we tried but we did't got the result
    Suchitra.




  6. #6
    Join Date
    May 1999
    Posts
    318

    Re: MDICHILDWINDOW

    I think you have to use the code when you want the window to be maximized.

    But i think there is a little mistake in code.
    So try this :


    WINDOWPLACEMENT pl;
    child.GetWindowPlacement(&pl)pl.showCmd|=SW_SHOWMAXIMIZED;
    child.SetWindowPlacement(&pl)








  7. #7
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: MDICHILDWINDOW

    I understand why you removed WS_OVERLAPPEDWINDOW now, to remove the minimize, restore and close boxes from the child frame. You will still need to logical-OR in the WS_MAXIMIZE bit during your override of CChildFrame::PreCreateWindow() to make it fill the whole space, though. You will also need to override the CWinApp::OnFileNew() behaviour to call CDocTemplate::SaveAllModified() and CDocTemplate::CloseAllDocuments() before opening the new document, so that you only have the one document open at a time, as with SDI.



    --
    Jason Teagle
    [email protected]

  8. #8
    Join Date
    May 1999
    Location
    India
    Posts
    98

    Re: MDICHILDWINDOW

    I have a relatively simpler solution. On the closure of a child window, post a custom message to the main frame window. In the message Handler, maximize the active child (Obtained through 'MDIGetActive' fn).


  9. #9
    Guest

    Re: MDICHILDWINDOW

    hello

    Thank you for your repsone..yes you got my idea...i got the solution in precreate window() i made cs &= ~system_menu instead
    of overlapped window which behaves as i want........once again thankyou....

    suchitra.....


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured