DefWindowProc

The DefWindowProc function calls the default window procedure to provide default processing for any window messages that an application does not process. This function ensures that every message is processed. DefWindowProc is called with the same parameters received by the window procedure.

LRESULT DefWindowProc(
  HWND hWnd,      // handle to window
  UINT Msg,       // message identifier
  WPARAM wParam,  // first message parameter
  LPARAM lParam   // second message parameter
);
 

Parameters

hWnd
Handle to the window procedure that received the message.
Msg
Specifies the message.
wParam
Specifies additional message information. The content of this parameter depends on the value of the Msg parameter.
lParam
Specifies additional message information. The content of this parameter depends on the value of the Msg parameter.

Return Values

The return value is the result of the message processing and depends on the message.

Remarks

Windows CE: If Msg is WM_SETTEXT, zero is returned.

DefWindowProc does not automatically call PostQuitMessage when it handles a WM_DESTROY message.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Window Procedures Overview, Window Procedure Functions, CallWindowProc, DefDlgProc, WindowProc