GWLPWNDPROC
GWLP_WNDPROC is a constant used with the Windows API to access or replace the window procedure associated with a specific window. It identifies the slot in the per-window user data where a pointer to the window procedure (WNDPROC) is stored. By using this index with GetWindowLongPtr or SetWindowLongPtr, applications can retrieve the current window procedure or install a new one, enabling window procedure subclassing or custom message handling.
In practice, a programmer commonly subclasses a window by setting a new window procedure and preserving the
The value of GWLP_WNDPROC is -4, and it is used with GetWindowLongPtr/SetWindowLongPtr to access the window
As an alternative to manual subclassing, modern code can use SetWindowSubclass, which provides safer, more managed