public static IntPtr SetWindowLongPtr(HWND hwnd, GWL nIndex, IntPtr dwNewLong)
{
if (IntPtr.Size == 4) {
// The SetWindowLongPtr entrypoint may not exist on 32-bit
// OSes, so use the legacy SetWindowLong function instead.
return new IntPtr(SetWindowLong(hwnd, nIndex, dwNewLong.ToInt32()));
} else {
return _SetWindowLongPtr(hwnd, nIndex, dwNewLong);
}
}