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