DefWindowProcW function (winuser.h)

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.

Syntax

LRESULT DefWindowProcW(
  [in] HWND   hWnd,
  [in] UINT   Msg,
  [in] WPARAM wParam,
  [in] LPARAM lParam
);
## Parameters

`[in] hWnd`

Type: <b>HWND</b>

A handle to the window procedure that received the message.

`[in] Msg`

Type: <b>UINT</b>

The message.

`[in] wParam`

Type: <b>WPARAM</b>

Additional message information. The content of this parameter depends on the value of the <i>Msg</i> parameter.

`[in] lParam`

Type: <b>LPARAM</b>

Additional message information. The content of this parameter depends on the value of the <i>Msg</i> parameter.


## Return value

Type: <b>LRESULT</b>

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

## Remarks

> [!NOTE]
> The winuser.h header defines DefWindowProc as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).

## Requirements
| &nbsp; | &nbsp; |
| ---- |:---- |
| **Minimum supported client** | Windows 2000 Professional [desktop apps only] |
| **Minimum supported server** | Windows 2000 Server [desktop apps only] |
| **Target Platform** | Windows |
| **Header** | winuser.h (include Windows.h) |
| **Library** | User32.lib |
| **DLL** | User32.dll |
| **API set** | ext-ms-win-ntuser-window-l1-1-0 (introduced in Windows 8) |

## See also

<a href="/windows/desktop/api/winuser/nf-winuser-callwindowproca">CallWindowProc</a>



<b>Conceptual</b>



<a href="/windows/desktop/api/winuser/nf-winuser-defdlgprocw">DefDlgProc</a>



<b>Reference</b>



<a href="/windows/desktop/winmsg/window-procedures">Window Procedures</a>



<a href="/previous-versions/windows/desktop/legacy/ms633573(v=vs.85)">WindowProc</a>