public static extern int GetWindowLong(IntPtr hWnd, WindowLongs nIndex);
public static extern uint SetWindowLong( IntPtr hWnd, [MarshalAs(UnmanagedType.U4)] WindowLongs nIndex, uint dwNewLong);
=> Marshal.GetLastWin32Error(); // This alias isn't strictly needed, but it reads better. #endregion #region GetWindowLong/SetWindowLong and friends public static IntPtr GetWindowLongPtr(IntPtr hWnd, WindowLongs nIndex) => GetWindowLongPtr(hWnd, (int)nIndex);
public static IntPtr SetWindowLongPtr(IntPtr hWnd, WindowLongs nIndex, IntPtr dwNewLong) => SetWindowLongPtr(hWnd, (int)nIndex, dwNewLong);
private static extern IntPtr SetWindowLongPtr64(HandleRef hWnd, WindowLongs nIndex, IntPtr dwNewLong);
private static extern IntPtr GetWindowLongPtr64(HandleRef hWnd, WindowLongs nIndex);
public static IntPtr SetWindowLong(HandleRef hWnd, WindowLongs nIndex, IntPtr dwNewLong) { if (IntPtr.Size == 4) { return SetWindowLong32(hWnd, nIndex, dwNewLong); } return SetWindowLongPtr64(hWnd, nIndex, dwNewLong); }
public static IntPtr GetWindowLong(HandleRef hWnd, WindowLongs nIndex) { if (IntPtr.Size == 4) { return GetWindowLong32(hWnd, nIndex); } return GetWindowLongPtr64(hWnd, nIndex); }
public static extern WindowStyle GetWindowLong(IntPtr hWnd, WindowLongs nIndex);