/// <summary> // This static method is required because legacy OSes do not support SetWindowLongPtr /// </summary> public static WindowStyleFlags SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStyleFlags dwNewLong) { if (IntPtr.Size == 8) { return(Native.SetWindowLong64(hWnd, nIndex, dwNewLong)); } return(Native.SetWindowLong32(hWnd, nIndex, dwNewLong)); }
/// <summary> // This static method is required because legacy OSes do not support SetWindowLongPtr /// </summary> public static WindowStyleFlags GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex) { if (IntPtr.Size == 8) { return(GetWindowLong64(hWnd, nIndex)); } return(GetWindowLong32(hWnd, nIndex)); }
/// <summary> /// Wrapper for the SetWindowLong which decides if the system is 64-bit or not and calls the right one. /// </summary> /// <param name="hwnd">IntPtr</param> /// <param name="index">WindowLongIndex</param> /// <param name="styleFlags"></param> public static void SetWindowLongWrapper(IntPtr hwnd, WindowLongIndex index, IntPtr styleFlags) { if (IntPtr.Size == 8) { SetWindowLongPtr(hwnd, index, styleFlags); } else { SetWindowLong(hwnd, index, styleFlags.ToInt32()); } }
// This static method is required because Win32 does not support // GetWindowLongPtr directly public static IntPtr GetWindowLongPtr(IntPtr hWnd, WindowLongIndex nIndex) { if (IntPtr.Size == 8) { return(GetWindowLongPtr64(hWnd, nIndex)); } else { return(GetWindowLongPtr32(hWnd, nIndex)); } }
public static WindowStyles SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStyles dwNewLong) { if (IntPtr.Size == 8) { return(SetWindowLong64(hWnd, nIndex, dwNewLong)); } else { return(SetWindowLong32(hWnd, nIndex, dwNewLong)); } }
/// <summary> /// Changes attributes of a window. /// </summary> public static IntPtr SetWindowLong(IntPtr windowHandle, WindowLongIndex index, IntPtr newLong) { IntPtr result; if (Environment.Is64BitProcess) { result = SetWindowLong64(windowHandle, (int)index, newLong); } else { result = SetWindowLong32(windowHandle, (int)index, newLong); } if (result == IntPtr.Zero) { int hResult = Marshal.GetHRForLastWin32Error(); Marshal.ThrowExceptionForHR(hResult); } return(result); }
public static extern WindowStyleFlags SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStyleFlags dwNewLong);
private static extern WindowStyleFlags GetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex);
public static uint GetWindowLongPtr(IntPtr handle, WindowLongIndex nIndex) { var rVal = (uint)(Platform.Is64Bit ? (uint)GetWindowLongPtr64(handle, nIndex).ToInt32() : GetWindowLongPtr32(handle, nIndex)); return(rVal); }
public static IntPtr GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex) { return IntPtr.Size == 4 ? NativeMethods.GetWindowLong32(hWnd, (int)nIndex) : NativeMethods.GetWindowLongPtr64(hWnd, (int)nIndex); }
public static WindowStyle GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex) { return(IntPtr.Size == 8 ? GetWindowLong64(hWnd, nIndex) : GetWindowLong32(hWnd, nIndex)); }
/// <summary> // This static method is required because legacy OSes do not support SetWindowLongPtr /// </summary> public static WindowStyleFlags SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStyleFlags dwNewLong) { if (IntPtr.Size == 8) return Native.SetWindowLong64(hWnd, nIndex, dwNewLong); return Native.SetWindowLong32(hWnd, nIndex, dwNewLong); }
internal static extern WindowStyles SetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex, WindowStyles dwNewLong);
private static extern WindowStyle SetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex, WindowStyle dwNewLong);
/// <summary> // This static method is required because legacy OSes do not support SetWindowLongPtr /// </summary> public static WindowStyleFlags GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex) { if (IntPtr.Size == 8) return Native.GetWindowLong64(hWnd, nIndex); return Native.GetWindowLong32(hWnd, nIndex); }
static extern uint GetWindowLong(IntPtr handle, WindowLongIndex index);
private static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, WindowLongIndex nIndex);
public static int SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, int newValue) { return(Win32API.SetWindowLong(hWnd, (short)nIndex, newValue)); }
public static int GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex) { return(Win32API.GetWindowLong(hWnd, (short)nIndex)); }
public static extern int SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStylesEx dwNewLong);
internal static extern WindowStyles GetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex);
private static extern WindowStyle GetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex);
static extern uint GetWindowLongPtr32(IntPtr handle, WindowLongIndex nIndex);
public static WindowStyle SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStyle dwNewLong) { return(IntPtr.Size == 8 ? SetWindowLong64(hWnd, nIndex, dwNewLong) : SetWindowLong32(hWnd, nIndex, dwNewLong)); }
static extern IntPtr GetWindowLongPtr64(IntPtr handle, WindowLongIndex nIndex);
public static extern IntPtr SetWindowLong(IntPtr hwnd, WindowLongIndex index, IntPtr handle);
private static extern WindowStyleFlags SetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex, WindowStyleFlags dwNewLong);
static extern uint SetWindowLongPtr32(IntPtr handle, WindowLongIndex nIndex, uint newLong);
public static extern int GetWindowLongPtr(IntPtr hwnd, WindowLongIndex nIndex);
static extern IntPtr SetWindowLongPtr64(IntPtr handle, WindowLongIndex nIndex, IntPtr newLong);
private static extern WindowStyleFlags GetWindowLong32(IntPtr hWnd, WindowLongIndex nIndex);
public unsafe static uint SetWindowLongPtr(IntPtr handle, WindowLongIndex nIndex, uint newLong) { var rVal = (uint)(Platform.Is64Bit ? (uint)SetWindowLongPtr64(handle, nIndex, new IntPtr(&newLong)).ToInt32() : SetWindowLongPtr32(handle, nIndex, newLong)); return(rVal); }
public static extern IntPtr SetWindowLongPtr(IntPtr hWnd, WindowLongIndex nIndex, uint value);
public static extern WindowStyleFlags GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex);
private static extern WindowStyleFlags SetWindowLong32(IntPtr hWnd, WindowLongIndex nIndex, WindowStyleFlags dwNewLong);
public static extern WindowStylesEx GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex);
public static extern int SetWindowLong(IntPtr hWnd, WindowLongIndex index, int dwNewLong);