DefFrameProc Function

The DefFrameProc function provides default processing for any window messages that the window procedure of a multiple-document interface (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.

Syntax

LRESULT DefFrameProc(      
    HWND hWnd,     HWND hWndMDIClient,     UINT uMsg,     WPARAM wParam,     LPARAM lParam );

Parameters

hWnd
[in] Handle to the MDI frame window.
hWndMDIClient
[in] Handle to the MDI client window.
uMsg
[in] Specifies the message to be processed.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.

Return Value

The return value specifies the result of the message processing and depends on the message. If the hWndMDIClient parameter is NULL, the return value is the same as for the DefWindowProc function.

Remarks

When an application's window procedure does not handle a message, it typically passes the message to the DefWindowProc function to process the message. MDI applications use the DefFrameProc and DefMDIChildProc functions instead of DefWindowProc to provide default message processing. All messages that an application would usually pass to DefWindowProc (such as nonclient messages and the WM_SETTEXT message) should be passed to DefFrameProc instead. The DefFrameProc function also handles the following messages.

MessageResponse
WM_COMMANDActivates the MDI child window that the user chooses. This message is sent when the user chooses an MDI child window from the window menu of the MDI frame window. The window identifier accompanying this message identifies the MDI child window to be activated.
WM_MENUCHAROpens the window menu of the active MDI child window when the user presses the ALT+ – (minus) key combination.
WM_SETFOCUSPasses the keyboard focus to the MDI client window, which in turn passes it to the active MDI child window.
WM_SIZEResizes the MDI client window to fit in the new frame window's client area. If the frame window procedure sizes the MDI client window to a different size, it should not pass the message to the DefWindowProc function.

Windows 95/98/Me: DefFrameProcW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

Function Information

Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systems Windows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.

See Also

Tags :


Community Content

dmex
vb.net syntax
<DllImport("user32.dll", CharSet:=CharSet.Auto)> Public Shared Function DefFrameProc(ByVal hWnd As IntPtr, ByVal hWndClient As IntPtr, ByVal msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function
Tags :

dmex
C# syntax
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr DefFrameProc(IntPtr hWnd, IntPtr hWndClient, int msg, IntPtr wParam, IntPtr lParam);
Tags :

Page view tracker