Multiple Document Interface

July 15, 2025 ยท View on GitHub

[Many new and intermediate users find it difficult to learn to use MDI applications. Therefore, you should consider other models for your user interface. However, you can use MDI for applications which do not easily fit into an existing model.]

The multiple-document interface (MDI) is a specification that defines a user interface for applications that enable the user to work with more than one document at the same time.

In This Section

TopicDescription
About the Multiple Document InterfaceDescribes the Multiple Document Interface.
Using the Multiple Document InterfaceExplains how to perform tasks associated with the Multiple Document Interface.
MDI ReferenceContains the API reference.

MDI Functions

NameDescription
CreateMDIWindowCreates a MDI child window.
DefFrameProcProvides default processing for any window messages that the window procedure of a MDI frame window does not process. All window messages that are not explicitly processed by the window procedure must be passed to the DefFrameProc function, not the DefWindowProc function.
DefMDIChildProcProvides default processing for any window message that the window procedure of a MDI child window does not process. A window message not processed by the window procedure must be passed to the DefMDIChildProc function, not to the DefWindowProc function.
TranslateMDISysAccelProcesses accelerator keystrokes for window menu commands of the MDI child windows associated with the specified MDI client window. The function translates WM_KEYUP and WM_KEYDOWN messages to WM_SYSCOMMAND messages and sends them to the appropriate MDI child windows.

MDI Messages

NameDescription
WM_MDIACTIVATESent to a MDI client window to instruct the client window to activate a different MDI child window.
WM_MDICASCADESent to a MDI client window to arrange all its child windows in a cascade format.
WM_MDICREATESent to a MDI client window to create an MDI child window.
WM_MDIDESTROYSent to a MDI client window to close an MDI child window.
WM_MDIGETACTIVESent to a MDI client window to retrieve the handle to the active MDI child window.
WM_MDIICONARRANGESent to a MDI client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized.
WM_MDIMAXIMIZESent to a MDI client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window.
WM_MDINEXTSent to a MDI client window to activate the next or previous child window.
WM_MDIREFRESHMENUSent to a MDI client window to refresh the window menu of the MDI frame window.
WM_MDIRESTORESent to a MDI client window to restore an MDI child window from maximized or minimized size.
WM_MDISETMENUSent to a MDI client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both.
WM_MDITILESent to a MDI client window to arrange all of its MDI child windows in a tile format.

MDI Structures

NameDescription
MDICREATESTRUCTContains information about the class, title, owner, location, and size of a MDI child window.