The Multiple Document Interface is described in the CUA Advanced Interface Design Guide. The main application window of an MDI program is conventional—it has a title bar, a menu, a sizing border, a system menu icon, and minimize/maximize icons. The client area, however, is often called a ”workspace“ and is not directly used to display program output. This workspace contains zero or more child windows, each of which displays a document.
These child windows look much like normal application windows. They have a title bar, a sizing border, a system menu icon, minimize/maximize icons, and possibly scroll bars. None of the document windows has a menu, however. The menu on the main application window applies to the document windows.
At any one time, only one document window is active (indicated by a highlighted title bar) and appears in front of all the other document windows. All the document child windows are clipped to the workspace area and never appear outside the application window.
At first, MDI seems a fairly straightforward job for the Windows programmer. All you need to do is create a WS_CHILD window for each document, making the program's main application window the parent of the document window. But with a little exploration of an MDI application such as the Windows 3 File Manager, you'll find some complications that require difficult code.
An MDI document window can be minimized. Its icon appears at the bottom of the workspace. (Generally an MDI application will use different icons for the main application window and each type of document window.)
An MDI document window can be maximized. In this case, the title bar of the document window (normally used to show the filename of the document in the window) disappears, and the filename appears appended to the application name in the application window's title bar. The system menu icon of the document window becomes the first item in the top-level menu of the application window. The icon to restore the size of the document window becomes the last item in the top-level menu and appears to the far right.
The system keyboard accelerator to close a document window is the same as that to close the main window, except using the Ctrl key rather than Alt. That is, Alt-F4 closes the application window while Ctrl-F4 closes the document window. In addition, Ctrl-F6 switches among the child document windows within the active MDI application. Alt-Spacebar invokes the system menu of the main window, as usual. Alt-- (minus) invokes the system menu of the active child document window.
When using the cursor keys to move among items on the menu, control normally passes from the system menu to the first item on the menu bar. In an MDI application, control passes from the application system menu to the active document system menu to the first item on the menu bar.
If the application is capable of supporting several types of child windows (for example, the worksheet and chart documents in Microsoft Excel), then the menu should reflect the operations associated with that type of document. This requires that the program change the menu when a different document window becomes active. In addition, when no document window exists, the menu should be stripped down to only those operations involved in opening a new document.
The top-level menu bar has an item called Window. By convention, this is the last item on the top-level menu bar except for Help. The Window submenu generally has options to arrange the document windows within the workspace. Document windows can be ”cascaded“ from the upper left or ”tiled“ so that each document window is fully visible. This submenu also has a list of all the document windows. Selecting one moves that document window to the foreground.
All of these aspects of MDI are supported in Windows 3. Some overhead is required of course (as will be shown in a sample program), but it's not anywhere close to the amount of code you'd have to write to support all these features directly.