public static IntPtr GetClassLongPtr(IntPtr hWnd, ClassLong i) { if (IntPtr.Size == 8) { return GetClassLong64(hWnd, (int)i); } return new IntPtr(GetClassLong32(hWnd, (int)i)); }
/// <summary> /// Replaces the specified value at the specified offset in the extra class memory or the WNDCLASSEX structure for the class to which the specified window belongs. /// </summary> /// <param name="hWnd">A handle to the window and, indirectly, the class to which the window belongs.</param> /// <param name="nIndex">The zero-based offset to the value to be set.</param> /// <param name="dwNewLong">The replacement value.</param> /// <returns>If the function succeeds, the return value is the previous value of the specified offset. If this was not previously set, the return value is zero.</returns> public static IntPtr SetClassLong(IntPtr hWnd, ClassLong nIndex, IntPtr dwNewLong) { if (PlatformInfo.Is64BitProcess) { return(NativeMethods.SetClassLongPtr(hWnd, nIndex, dwNewLong)); } return(new IntPtr(NativeMethods.SetClassLong(hWnd, nIndex, (uint)dwNewLong))); }
/// <summary> /// Retrieves the specified value from the WNDCLASSEX structure associated with the specified window. /// </summary> /// <param name="hWnd">A handle to the window and, indirectly, the class to which the window belongs.</param> /// <param name="nIndex">Index of the value.</param> /// <returns></returns> public static IntPtr GetClassLong(IntPtr hWnd, ClassLong nIndex) { if (PlatformInfo.Is64BitProcess) { return(NativeMethods.GetClassLongPtr(hWnd, nIndex)); } return(new IntPtr(NativeMethods.GetClassLong(hWnd, nIndex))); }
public static IntPtr GetClassLongPtr(IntPtr hWnd, ClassLong i) { if (IntPtr.Size == 8) { return(GetClassLong64(hWnd, (int)i)); } return(new IntPtr(GetClassLong32(hWnd, (int)i))); }
/// <summary> /// Retrieves the specified value from the WNDCLASSEX structure associated with the specified window. /// </summary> /// <param name="hWnd">A handle to the window and, indirectly, the class to which the window belongs.</param> /// <param name="nIndex">Index of the value.</param> /// <returns></returns> public static IntPtr GetClassLong(IntPtr hWnd, ClassLong nIndex) { if (PlatformInfo.Is64BitProcess) { return NativeMethods.GetClassLongPtr(hWnd, nIndex); } return new IntPtr(NativeMethods.GetClassLong(hWnd, nIndex)); }
public static IntPtr GetClassLong(WindowHandle window, ClassLong index) { // Unfortunate, but this is necessary to tell if there is really an error ErrorMethods.SetLastError(WindowsError.NO_ERROR); IntPtr result = Support.Environment.Is64BitProcess ? (IntPtr)Imports.GetClassLongPtrW(window, index) : (IntPtr)Imports.GetClassLongW(window, index); if (result == IntPtr.Zero) { Errors.ThrowIfLastErrorNot(WindowsError.ERROR_SUCCESS); } return(result); }
public static IntPtr SetClassLong(WindowHandle window, ClassLong index, IntPtr value) { // Unfortunate, but this is necessary to tell if there is really an error // (Even though this is only documented on SetWindowLong, happens here too) ErrorMethods.SetLastError(WindowsError.NO_ERROR); IntPtr result = Support.Environment.Is64BitProcess ? (IntPtr)Imports.SetClassLongPtrW(window, index, value.ToInt64()) : (IntPtr)Imports.SetClassLongW(window, index, value.ToInt32()); if (result == IntPtr.Zero) { Errors.ThrowIfLastErrorNot(WindowsError.ERROR_SUCCESS); } return(result); }
public static IntPtr SetClassLongPtr(IntPtr hWnd, NativeConstants.GetClassLong nIndex, IntPtr dwNewLong) => OS.Is64Bit ? ClassLong.SetClassLongPtrW(hWnd, nIndex, dwNewLong) : new IntPtr(ClassLong.SetClassLongW(hWnd, nIndex, dwNewLong.ToInt32()));
public static extern long GetClassLongPtrW( WindowHandle hWnd, ClassLong nIndex);
public static extern long SetClassLongPtrW( WindowHandle hWnd, ClassLong nIndex, long dwNewLong);
public static extern uint SetClassLong(IntPtr hWnd, ClassLong nIndex, uint dwNewLong);
public static extern uint GetClassLong(IntPtr hWnd, ClassLong nIndex);
/// <summary> /// Replaces the specified value at the specified offset in the extra class memory or the WNDCLASSEX structure for the class to which the specified window belongs. /// </summary> /// <param name="hWnd">A handle to the window and, indirectly, the class to which the window belongs.</param> /// <param name="nIndex">The zero-based offset to the value to be set.</param> /// <param name="dwNewLong">The replacement value.</param> /// <returns>If the function succeeds, the return value is the previous value of the specified offset. If this was not previously set, the return value is zero.</returns> public static IntPtr SetClassLong(IntPtr hWnd, ClassLong nIndex, IntPtr dwNewLong) { if (PlatformInfo.Is64BitProcess) { return NativeMethods.SetClassLongPtr(hWnd, nIndex, dwNewLong); } return new IntPtr(NativeMethods.SetClassLong(hWnd, nIndex, (uint)dwNewLong)); }
public static IntPtr SetClassLong(this WindowHandle window, ClassLong index, IntPtr value) => WindowMethods.SetClassLong(window, index, value);
private static extern IntPtr GetClassLongPtr(WindowHandle hWnd, ClassLong nIndex);
public static extern IntPtr GetClassLongPtr(IntPtr hWnd, ClassLong nIndex);
public static extern IntPtr SetClassLongPtr(IntPtr hWnd, ClassLong nIndex, IntPtr dwNewLong);
public static extern int GetClassLongW( WindowHandle hWnd, ClassLong nIndex);
public static extern int SetClassLongW( WindowHandle hWnd, ClassLong nIndex, int dwNewLong);
public static IntPtr GetClassLongPtr(IntPtr hWnd, NativeConstants.GetClassLong nIndex) => new IntPtr(OS.Is64Bit ? ClassLong.GetClassLongPtrW(hWnd, nIndex) : ClassLong.GetClassLongW(hWnd, nIndex));