Click to See Complete Forum and Search --> : MDICHILDWINDOW


June 4th, 1999, 01:49 AM
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...........

eric33
June 4th, 1999, 02:31 AM
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.

Jason Teagle
June 4th, 1999, 02:32 AM
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?

June 4th, 1999, 09:17 AM
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.

June 4th, 1999, 09:20 AM
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.

eric33
June 4th, 1999, 09:37 AM
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)

Jason Teagle
June 7th, 1999, 02:27 AM
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.

as_prabhu
June 7th, 1999, 06:38 AM
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).

June 8th, 1999, 03:28 AM
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.....