public static IntPtr SetWindowLong(HandleRef hWnd, WindowLongValue nIndex, IntPtr dwNewLong) { int error = 0; IntPtr result = IntPtr.Zero; SetLastError(0); if (IntPtr.Size == 4) { int intResult = IntSetWindowLong(hWnd, (int)nIndex, IntPtrToInt32(dwNewLong)); error = Marshal.GetLastWin32Error(); result = new IntPtr(intResult); } else { result = IntSetWindowLongPtr(hWnd, (int)nIndex, dwNewLong); error = Marshal.GetLastWin32Error(); } return(result); }
public static int GetWindowLong(HandleRef hWnd, WindowLongValue nIndex, out int error) { int result; Kernel32.SetLastError(0); if (IntPtr.Size == 4) { result = IntGetWindowLong(hWnd, (int)nIndex); error = Marshal.GetLastWin32Error(); } else { var resultPtr = IntGetWindowLongPtr(hWnd, (int)nIndex); error = Marshal.GetLastWin32Error(); result = (int)resultPtr.ToInt64(); } return(result); }
public static int GetWindowLong(HandleRef hWnd, WindowLongValue nIndex) { int result = 0; int error = 0; SetLastError(0); if (IntPtr.Size == 4) { result = IntGetWindowLong(hWnd, (int)nIndex); error = Marshal.GetLastWin32Error(); } else { IntPtr resultPtr = IntGetWindowLongPtr(hWnd, (int)nIndex); error = Marshal.GetLastWin32Error(); result = IntPtrToInt32(resultPtr); } return(result); }
public static IntPtr SetWindowLong(HandleRef hWnd, WindowLongValue nIndex, IntPtr dwNewLong, out int error) { IntPtr result; Kernel32.SetLastError(0); if (IntPtr.Size == 4) { var intResult = IntSetWindowLong(hWnd, (int)nIndex, (int)dwNewLong.ToInt64()); error = Marshal.GetLastWin32Error(); result = new IntPtr(intResult); } else { result = IntSetWindowLongPtr(hWnd, (int)nIndex, dwNewLong); error = Marshal.GetLastWin32Error(); } return(result); }
public static IntPtr SetWindowLong(HandleRef hWnd, WindowLongValue nIndex, IntPtr dwNewLong) { int error = 0; IntPtr result = IntPtr.Zero; SetLastError(0); if (IntPtr.Size == 4) { int intResult = IntSetWindowLong(hWnd, (int)nIndex, IntPtrToInt32(dwNewLong)); error = Marshal.GetLastWin32Error(); result = new IntPtr(intResult); } else { result = IntSetWindowLongPtr(hWnd, (int)nIndex, dwNewLong); error = Marshal.GetLastWin32Error(); } return result; }
public static int GetWindowLong(HandleRef hWnd, WindowLongValue nIndex) { int result = 0; int error = 0; SetLastError(0); if (IntPtr.Size == 4) { result = IntGetWindowLong(hWnd, (int)nIndex); error = Marshal.GetLastWin32Error(); } else { IntPtr resultPtr = IntGetWindowLongPtr(hWnd, (int)nIndex); error = Marshal.GetLastWin32Error(); result = IntPtrToInt32(resultPtr); } return result; }
public static IntPtr SetWindowLong(HandleRef hWnd, WindowLongValue nIndex, IntPtr dwNewLong) { int error; IntPtr result; SetLastError(0); if (IntPtr.Size == 4) { var intResult = IntSetWindowLong(hWnd, (int) nIndex, IntPtrToInt32(dwNewLong)); error = Marshal.GetLastWin32Error(); result = new IntPtr(intResult); } else { result = IntSetWindowLongPtr(hWnd, (int) nIndex, dwNewLong); error = Marshal.GetLastWin32Error(); } if (error != 0) { throw new Win32Exception(error); } return result; }
public static int GetWindowLong(HandleRef hWnd, WindowLongValue nIndex) { int result; int error; SetLastError(0); if (IntPtr.Size == 4) { result = IntGetWindowLong(hWnd, (int) nIndex); error = Marshal.GetLastWin32Error(); } else { var resultPtr = IntGetWindowLongPtr(hWnd, (int) nIndex); error = Marshal.GetLastWin32Error(); result = IntPtrToInt32(resultPtr); } if (error != 0) { throw new Win32Exception(error); } return result; }
public static int GetWindowLong(HandleRef hWnd, WindowLongValue nIndex) { return(GetWindowLong(hWnd, nIndex, out _)); }
public static IntPtr SetWindowLong(HandleRef hWnd, WindowLongValue nIndex, IntPtr dwNewLong) { return(SetWindowLong(hWnd, nIndex, dwNewLong, out _)); }