SetWindowLongPtr
SetWindowLongPtr is a Windows API function that stores or retrieves a per-window value in a manner that is safe for 64-bit applications. It is commonly used to subclass a window by replacing its window procedure or to associate application data with a window. On 64-bit Windows, SetWindowLongPtr provides a pointer-sized alternative to the older SetWindowLong function, which helps maintain compatibility and correctness across architectures.
The function takes three parameters: a handle to the window (HWND hWnd), an index specifying which value
The return value is the previous value stored at the specified slot. If the function fails, the
Compatibility notes: SetWindowLongPtr replaces SetWindowLong on 64-bit systems. For 32-bit code, SetWindowLongPtr is usually defined to
See also: GetWindowLongPtr, GetWindowLong, SetWindowLong, GWLP_WNDPROC, GWLP_USERDATA, CallWindowProc.