CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582

    [RESOLVED] modeless dialog in MDI app

    I have an MDI application with windows that can maximize, minimize, etc.--all the default functionality you'd expect.

    I have one MDI child window that behaves as a modeless dialog that I want to not maximize with the rest of the windows.

    I know how to prevent the user from maximizing this window by removing the WS_MAXIMIZEBOX in PreCreateWindow, but then switching to this window will restore all other windows from a maximized state.

    Is there a way to have some MDI child windows in a maximized state and others not?

    Thanks for any help,

    Jeff

  2. #2
    Join Date
    Jun 2002
    Location
    Stockholm, Sweden
    Posts
    1,641

    Re: modeless dialog in MDI app

    Nobody cares how it works as long as it works

  3. #3
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582

    Re: modeless dialog in MDI app

    zerver,

    Thanks for the answer. I tried it, and this solution only blocks the action of clicking on the maximize button. So, double clicking on the title bar still maximizes. There's likely another syscommand for this, but there is no sys command when the window is maximized due to another child window being maximized.

    Any other ideas?

    Jeff

  4. #4
    Join Date
    Feb 2002
    Posts
    3,788

    Re: modeless dialog in MDI app

    did you try handling WM_GETMINMAXINFO or WM_WINDOWPOSCHANGING and see what happens?

  5. #5
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582

    Re: modeless dialog in MDI app

    Alin,

    I did try handling WM_GETMINMAXINFO. It did correctly restrict the size of the window, but it still behaved maximized. It lost the title bar. Also when it was the active window, the other child windows showed in the restored state.

    I'm fairly convinced that I can't get the behavior I want--at least not through simple message handling and window styles. I'm now going to look into solutions where the window is not a child window.

    Thanks for the suggestion,

    Jeff

  6. #6
    Join Date
    Jun 2002
    Location
    Stockholm, Sweden
    Posts
    1,641

    Re: modeless dialog in MDI app

    If you are desperate to do it, i guess you could make your own classes derived from CMDIFrameWnd / CMDIChildWnd.

    Have a look in WINMDI.CPP, CMDIChildWnd::OnWindowPosChanging seems to adjust some sizes. CMDIChildWnd::UpdateClientEdge also seems interesting to you.
    Nobody cares how it works as long as it works

  7. #7
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582

    Re: modeless dialog in MDI app

    zerver,

    Anything's possible--it's only software after all. It's just a matter of cost. I've learned that venturing off the beaten MFC path is fraught with peril. We're looking to other solutions which I'm sure will be acceptable.

    Thanks for your help,

    Jeff

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