Click here to Skip to main content
Licence 
First Posted 26 Apr 2000
Views 98,064
Bookmarked 33 times

MDI Windows Manager Dialog

By | 29 Apr 2000 | Article
Implementing "Windows..." dialog
  • Download source files - 4.6 Kb
  • Download demo project - 36.5 Kb
  • Sample Image - WindowsManager.gif

    What's this?

    This article describes how to implement a Windows Manager dialog. It manages currently open windows (Activate, Save, Close, Tile, Cascade, Minimize).

    How to use it?

    1. Add to your CMainFrame a class member variable of type CMDIClient. A good practice is to keep the variables protected (or private).

    2. Then, within the OnCreate() handler, add the following code:

    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
        if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
           return -1;
    	
         // Subclass the MDI client window
         VERIFY(m_MDIClient.SubclassWindow(m_hWndMDIClient));
    
         return 0;
    }
    

    3. Copy to your project the provided IDD_WINDOW_MANAGE dialog resource (from WindowManager.rct).

    4. Add the following resource strings:

    ID Caption Description
    IDS_WINDOW_WINDOWS "&Windows..." Menu text
    ID_WINDOW_MANAGE "Manages the currently open windows.\nWindows List" Message prompt

    5. Add a handler to command ID_WINDOW_MANAGE and add the following code.

    void CMainFrame::OnWindowManage()
    {
        m_MDIClient.ManageWindows(this);
    }
    

    6. Build and run your application.

    7. Go to Window menu and click on "Windows..."

    Unicode?

    Unicode has not been tested, but it should work.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Ivan Zhakov

    Web Developer

    Russian Federation Russian Federation

    Member

    I started with programming more than ten years ago when I was teenager.
    Since that time I had experience varying from Windows desktop applications to embedded Linux development.
    For present time I'm developer of the Subversion Project and also co-founder of the VisualSVN company which develops integration between Subversion and Microsoft Visual Studio.

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralUseful example for improving MFC knowledge PinmemberRaymond_Gimilio7:32 26 Feb '07  
    GeneralRe: Useful example for improving MFC knowledge [modified] PinmemberIvan Zhakov7:58 26 Feb '07  
    GeneralWindow manager conflicts with tab control... Pinmemberatali5:52 21 Oct '04  
    QuestionHow to add list of Documents as Tree Items??? Pinmembermahatma_cis3:23 5 Aug '04  
    Generalquestion Pinsusslehaiquang20:31 17 Sep '03  
    Generaltree Pinmemberyaser10:42 30 Aug '02  
    GeneralFit a dialog in a View of a Window PinmemberAnonymous8:55 17 Apr '02  
    GeneralRe: Fit a dialog in a View of a Window PinmemberJim Busse10:27 13 Nov '02  
    GeneralHorizontal Scroll Bar PinsussGeorge Poulose18:45 1 May '00  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web03 | 2.5.120517.1 | Last Updated 30 Apr 2000
    Article Copyright 2000 by Ivan Zhakov
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid