MDI Windows Manager dialog | CodeGuru

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 29, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

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…

Advertisement

Unicode?

Not tested, but should work.

Downloads

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

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.