• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

CMDIFrameWnd question

Hi,
How can I set the CmdShow (Maximized or Normal) status of the ChildFrm windows from within the MainFrm window.
(I do not want to do it from the childfrm code by ActivateFrame method but from the MainFrm window).

thanks,
Yoav.
0
yoavo
Asked:
yoavo
1 Solution
 
missionImpossibleCommented:
call ChildFrames ShowWindow()-member and pass parameter
SW_SHOWMAXIMIZED:

ShowWindow(SW_SHOWMAXIMIZED)
0
 
yoavoAuthor Commented:
This is not what I was looking for.
I do not want to maximize a specific CChildFrm window. I want to set a style (or something like this) in the creation/initialization of the MainFrm which will cause all the ChildFrm's to open maximized.

0
 
migelCommented:
Hi!
dear Yavo
you already ask about that in your previus q.
CMainFrame haven`t such feature. So you must dervie your own CMdiChildWnd class to handle ActivateFrame and use it in all DocTemplates you have registered in the app.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ekcCommented:
migel is right. You can't do that from the parent window, at least not too much nice.
Use PreCreateWindow() function of your child window, this is the natural place to manage the window's look.
0
 
yoavoAuthor Commented:
My problem is that I want my MDI program to check if the child window is maximized within
the parent window when the program is terminated, and to restore that
state the next time the program is run.
If I do it on ActivateFrame as you suggested than all the child window will be open in the same way, ignoring the fact that the user might change the status of a certain child window, and expect that the next window will be open in the same way.
Ofcourse I can do it in an ugly way by reading the status only for the first child window but I am trying to avoid that...

0
 
migelCommented:
hm
look at PAQ for "storing window state"
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now