Help with MDI
Hi David,
> I have several questions. I'm using VC++ and MFC to build a MDI app.
> 1) Is it possible to make a modless dialog box not stay on top
> relative to the MDI child windows?
If you don't want the modeless dialog box to on top of the MDI child
windows, then try calling SetWindowPos() during its killfocus.
> 2) I have two Document templates in my MDI app. Doc1 uses a view
> derived from CFormView. I want the view to look like a dialog box and
> not be sizable so I don't have a sizable border or Maximize box.
The CFormView can not have a WS_BORDER style. However, I believe you can
get rid of the Maximize box by overidding the PreCreateWindow() and
remove the WS_MAXIMIZEBOX style.
> The problem is that if both documents are open and the other view,
> view2, is maximized and then I switch to view1, it will be maximized
> also. Is there a good way to avoid this?
You can probably trap the WM_SETFOCUS for View1 and check if it's
maximized, if it is then reposition it with SetWindowPlacement().
> 2) When I click the maximize box in a MDI Child window I would like
> the MDI Child window not to maximize, but expand the window to a
> pre-defined size, then change the maximize box to the restore box.
You can trap the WM_SIZE message and handle this. The nType will tell you
if the window is being min. or max.
Regards!
Brian Ku
-Microsoft Developer Support