internal static IntPtr SetWindowLong_N(IntPtr handle, GetWindowLongOffsets item, IntPtr newValue) { return(IntPtr.Size == 4 ? (IntPtr)SetWindowLong(handle, item, newValue.ToInt32()) : SetWindowLongPtr(handle, item, newValue)); }
static extern LONG_PTR SetWindowLongPtrInternal(HWND hWnd, GetWindowLongOffsets nIndex, [MarshalAs(UnmanagedType.FunctionPtr)]WindowProcedure dwNewLong);
static extern ULONG GetWindowLongInternal(HWND hWnd, GetWindowLongOffsets nIndex);
internal static extern LONG_PTR GetWindowLongPtr( HWND hWnd, GetWindowLongOffsets nIndex );
static extern LONG SetWindowLongInternal(HWND hWnd, GetWindowLongOffsets nIndex, LONG dwNewLong);
private static UIntPtr GetWindowLongPtrInternal(IntPtr hWnd, GetWindowLongOffsets nIndex);
private static IntPtr SetWindowLongPtr(IntPtr hWnd, GetWindowLongOffsets nIndex, IntPtr dwNewLong);
public static extern long GetWindowLong(IntPtr hWnd, GetWindowLongOffsets nIndex);
private static extern IntPtr SetWindowLongPtrInternal(IntPtr hWnd, GetWindowLongOffsets nIndex, IntPtr dwNewLong);
static extern UIntPtr GetWindowLongPtr(IntPtr hWnd, GetWindowLongOffsets nIndex);
static extern int SetWindowLongInternal(IntPtr hWnd, GetWindowLongOffsets nIndex, int dwNewLong);
static extern uint GetWindowLong(IntPtr hWnd, GetWindowLongOffsets nIndex);
internal static UIntPtr GetWindowLong_N(IntPtr handle, GetWindowLongOffsets index) { return(IntPtr.Size == 4 ? (UIntPtr)GetWindowLong(handle, index) : GetWindowLongPtr(handle, index)); }
static extern IntPtr SetWindowLongPtr(IntPtr hWnd, GetWindowLongOffsets nIndex, IntPtr dwNewLong);
internal static IntPtr SetWindowLong(IntPtr handle, GetWindowLongOffsets item, IntPtr newValue) { IntPtr num = IntPtr.Zero; Functions.SetLastError(0); num = IntPtr.Size != 4 ? Functions.SetWindowLongPtr(handle, item, newValue) : new IntPtr(Functions.SetWindowLong(handle, item, newValue.ToInt32())); if (num == IntPtr.Zero) { int lastWin32Error = Marshal.GetLastWin32Error(); if (lastWin32Error != 0) throw new PlatformException(string.Format("Failed to modify window border. Error: {0}", (object) lastWin32Error)); } return num; }
internal static UIntPtr GetWindowLong_N(IntPtr handle, GetWindowLongOffsets index) { return IntPtr.Size == 4 ? (UIntPtr)GetWindowLong(handle, index) : GetWindowLongPtr(handle, index); }
private static uint GetWindowLongInternal(IntPtr hWnd, GetWindowLongOffsets nIndex);
internal static IntPtr SetWindowLong_N(IntPtr handle, GetWindowLongOffsets item, IntPtr newValue) { return IntPtr.Size == 4 ? (IntPtr)SetWindowLong(handle, item, newValue.ToInt32()) : SetWindowLongPtr(handle, item, newValue); }
private static int SetWindowLong(IntPtr hWnd, GetWindowLongOffsets nIndex, int dwNewLong);
private static IntPtr SetWindowLongPtr(IntPtr hWnd, GetWindowLongOffsets nIndex, [MarshalAs(UnmanagedType.FunctionPtr)] WindowProcedure dwNewLong);
// SetWindowLongPtr does not exist on x86 platforms (it's a macro that resolves to SetWindowLong). // We need to detect if we are on x86 or x64 at runtime and call the correct function // (SetWindowLongPtr on x64 or SetWindowLong on x86). Fun! internal static IntPtr SetWindowLong(IntPtr handle, GetWindowLongOffsets item, IntPtr newValue) { // SetWindowPos defines its error condition as an IntPtr.Zero retval and a non-0 GetLastError. // We need to SetLastError(0) to ensure we are not detecting on older error condition (from another function). IntPtr retval = IntPtr.Zero; SetLastError(0); if (IntPtr.Size == 4) retval = new IntPtr(SetWindowLongInternal(handle, item, newValue.ToInt32())); else retval = SetWindowLongPtrInternal(handle, item, newValue); if (retval == IntPtr.Zero) { int error = Marshal.GetLastWin32Error(); if (error != 0) throw new PlatformException(String.Format("Failed to modify window border. Error: {0}", error)); } return retval; }
static extern int SetWindowLong(IntPtr hWnd, GetWindowLongOffsets nIndex, int dwNewLong);
static extern LONG_PTR SetWindowLongPtrInternal(HWND hWnd, GetWindowLongOffsets nIndex, LONG_PTR dwNewLong);
internal static UIntPtr GetWindowLong(IntPtr handle, GetWindowLongOffsets index) { if (IntPtr.Size == 4) return (UIntPtr)GetWindowLongInternal(handle, index); return GetWindowLongPtrInternal(handle, index); }
internal static UIntPtr GetWindowLong(IntPtr handle, GetWindowLongOffsets index) { if (IntPtr.Size == 4) return (UIntPtr) Functions.GetWindowLongInternal(handle, index); else return Functions.GetWindowLongPtrInternal(handle, index); }
static extern UIntPtr GetWindowLongPtrInternal(HWND hWnd, GetWindowLongOffsets nIndex);
internal static extern long SetWindowLong(IntPtr hWnd, GetWindowLongOffsets nIndex, long dwNewLong);