LRESULT DefWindowProcW(
[in] HWND hWnd,
[in] UINT Msg,
[in] WPARAM wParam,
[in] LPARAM lParam
);
What is the implementation of DefWindowProcW
?
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-defwindowprocw
LRESULT DefWindowProcW(
[in] HWND hWnd,
[in] UINT Msg,
[in] WPARAM wParam,
[in] LPARAM lParam
);
What is the implementation of DefWindowProcW
?
1 Answer
Reset to default -1Purpose of DefWindowProcW() is handle the WM_* messages
There are 260 WM_* are defined in #include <windows.h>
which you can get when you download "Microsoft Visual Studio Community 2019"
$ grep "define WM_" windows.h | wc -l
260
DefWindowProcW() has default implementation of these 260 WM_* (windows messages).
and you can see some of them under https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/win32u/defwnd.c#L2388
DefWindowProcW
is the default implementation for window classes (including controls). Most of it is undocumented, with a few exceptions (such asWM_CLOSE
message processing). It's generally not required to know what it does to use it. – IInspectable Commented yesterday