Exemplo n.º 1
0
 public static IntPtr GetClassLongPtr(IntPtr hWnd, ClassLong i)
 {
     if (IntPtr.Size == 8) {
         return GetClassLong64(hWnd, (int)i);
     }
     return new IntPtr(GetClassLong32(hWnd, (int)i));
 }
Exemplo n.º 2
0
 /// <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)));
 }
Exemplo n.º 3
0
 /// <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)));
 }
Exemplo n.º 5
0
 /// <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));
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 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);
Exemplo n.º 10
0
 public static extern long SetClassLongPtrW(
     WindowHandle hWnd,
     ClassLong nIndex,
     long dwNewLong);
Exemplo n.º 11
0
 public static extern uint SetClassLong(IntPtr hWnd, ClassLong nIndex, uint dwNewLong);
Exemplo n.º 12
0
 public static extern uint GetClassLong(IntPtr hWnd, ClassLong nIndex);
Exemplo n.º 13
0
 /// <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));
 }
Exemplo n.º 14
0
 public static IntPtr SetClassLong(this WindowHandle window, ClassLong index, IntPtr value) => WindowMethods.SetClassLong(window, index, value);
Exemplo n.º 15
0
 private static extern IntPtr GetClassLongPtr(WindowHandle hWnd, ClassLong nIndex);
Exemplo n.º 16
0
 public static extern uint GetClassLong(IntPtr hWnd, ClassLong nIndex);
Exemplo n.º 17
0
 public static extern IntPtr GetClassLongPtr(IntPtr hWnd, ClassLong nIndex);
Exemplo n.º 18
0
 public static extern IntPtr GetClassLongPtr(IntPtr hWnd, ClassLong nIndex);
Exemplo n.º 19
0
 public static extern IntPtr SetClassLongPtr(IntPtr hWnd, ClassLong nIndex, IntPtr dwNewLong);
Exemplo n.º 20
0
 public static extern uint SetClassLong(IntPtr hWnd, ClassLong nIndex, uint dwNewLong);
Exemplo n.º 21
0
 public static extern int GetClassLongW(
     WindowHandle hWnd,
     ClassLong nIndex);
Exemplo n.º 22
0
 public static extern IntPtr SetClassLongPtr(IntPtr hWnd, ClassLong nIndex, IntPtr dwNewLong);
Exemplo n.º 23
0
 public static extern int SetClassLongW(
     WindowHandle hWnd,
     ClassLong nIndex,
     int dwNewLong);
Exemplo n.º 24
0
 public static IntPtr GetClassLongPtr(IntPtr hWnd, NativeConstants.GetClassLong nIndex) =>
 new IntPtr(OS.Is64Bit ? ClassLong.GetClassLongPtrW(hWnd, nIndex) : ClassLong.GetClassLongW(hWnd, nIndex));