MDI Windows Manager dialog

Environment: VC++ 5.0; NT 4.0

What's this?

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

How to use it?

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

2. Then within OnCreate() handler add a 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 IDD_WINDOW_MANAGE dialog (from WindowManager.rct).

4. Add folowing resource strings:

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

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

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

6. Build and run your application.

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

Unicode?

Not tested, but should work.

Downloads

Download demo project - 41,3 KB
Download source - 4,6 KB


Comments

  • This code makes modal dialog modeless !!

    Posted by Legacy on 12/20/1999 12:00am

    Originally posted by: Kaizen

    If invoked by a modal dialog's menu, the Windows Manager makes the dialog modeless !!

    While interesting, this behavior is not desirable. Any fix?

    Reply
  • Download Links Fixed by Codeguru

    Posted by Legacy on 07/17/1999 12:00am

    Originally posted by: Brian Hart

    Codeguru has now fixed the 'Download Demo Project' and 'Download Source Code' links on the main page of this article.

    Brian
    http://www.wndbsoft.com/dev/

    Reply
  • Show appreciation for good codes...

    Posted by Legacy on 05/17/1999 12:00am

    Originally posted by: Paul Selormey

    Hello Happy-Dog,
    The codes shown here may not illustrate any new
    feature but the implementation is solid and teaches some
    cool stuff. Please read the codes carefully, you might learn
    something.

    Bye,
    Paul.

    Reply
  • no special useful information

    Posted by Legacy on 05/04/1999 12:00am

    Originally posted by: Happy--Dog

    hope get more useful info

    Reply
  • No Links even on comments

    Posted by Legacy on 05/03/1999 12:00am

    Originally posted by: C Urquhart

    The links are broken

    Reply
  • Here's the file locations

    Posted by Legacy on 05/02/1999 12:00am

    Originally posted by: Richard A. Nichols

    This is getting old!

    Here are the url's, the 's' was left out of the names

    /doc_view/WindowsManager_demo.zip
    /doc_view/WindowsManager_src.zip


    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • CentreCorp is a fully integrated and diversified property management and real estate service company, specializing in the "shopping center" segment, and is one of the premier retail service providers in North America. Company executives travel a great deal, carrying a number of traveling laptops with critical current business data, and no easy way to back up to the network outside the office. Read this case study to learn how CentreCorp implemented a suite of business continuity services that included …

Most Popular Programming Stories

More for Developers

RSS Feeds