LONG DefFrameProc(hWnd,hWndMDIClient,wMsg,wParam,lParam)
This function provides default processing for any Windows messages that the window function of a multiple document interface (MDI) frame window does not process. All window messages that are not explicitly processed by the window function must be passed to the DefFrameProc function, not the DefWindowProc function.
Parameter | Type/Description |
hWnd | HWND Identifies the MDI frame window. | |
hWndMDIClient | HWND Identifies the MDI client window. | |
wMsg | WORD Specifies the message number. | |
wParam | WORD Specifies 16 bits of additional message-dependent information. | |
lParam | DWORD Specifies 32 bits of additional message-dependent information. |
The return value specifies the result of the message processing and depends on the actual message sent. If the hWndMDIClient parameter is NULL, the return value is the same as for the DefWindowProc function.
Normally, when an application's window procedure does not handle a message, it passes the message to the DefWindowProc function, which processes the message. MDI applications use the DefFrameProc and DefMDIChildProc functions instead of DefWindowProc to provide default message processing. All messages that an application would normally pass to DefWindowProc (such as nonclient messages and WM_SETTEXT) should be passed to DefFrameProc instead. In addition to these, DefFrameProc also handles the following messages:
Message | Default Processing by DefFrameProc |
WM_COMMAND | The frame window of an MDI application receives the WM_COMMAND message to activate a particular MDI child window. The window ID accompanying this message will be the ID of the MDI child window assigned by Windows, starting with the first ID specified by the application when it created the MDI client window. This value of the first ID must not conflict with menu-item IDs. |
WM_MENUCHAR | When the ALT+HYPHEN key is pressed, the control menu of the active MDI child window will be selected. |
WM_SETFOCUS | DefFrameProc passes focus on to the MDI client, which in turn passes the focus on to the active MDI child window. |
WM_SIZE | If the frame window procedure passes this message to DefFrameProc, the MDI client window will be resized to fit in the new client area. If the frame window procedure sizes the MDI client to a different size, it should not pass the message to DefWindowProc. |