Example #1
0
 // This is aliased as a macro in 32bit Windows.
 public static IntPtr SetWindowLongPtr(IntPtr hwnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (8 == IntPtr.Size)
     {
         return(SetWindowLongPtr64(hwnd, nIndex, dwNewLong));
     }
     return(SetWindowLongPtr32(hwnd, nIndex, dwNewLong));
 }
Example #2
0
        public static IntPtr SetWindowLong(HandleRef hWnd, GWL nIndex, WNDPROCINT dwNewLong)
        {
            IntPtr pointer = Marshal.GetFunctionPointerForDelegate(dwNewLong);
            IntPtr result  = SetWindowLong(hWnd.Handle, nIndex, pointer);

            GC.KeepAlive(hWnd.Wrapper);
            return(result);
        }
Example #3
0
        public static IntPtr SetWindowLong(HandleRef hWnd, GWL nIndex, HandleRef dwNewLong)
        {
            IntPtr result = SetWindowLong(hWnd.Handle, nIndex, dwNewLong.Handle);

            GC.KeepAlive(hWnd.Wrapper);
            GC.KeepAlive(dwNewLong.Wrapper);
            return(result);
        }
Example #4
0
 public static IntPtr SetWindowLong(IntPtr hWnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (IntPtr.Size == 4)
     {
         return(SetWindowLongW(hWnd, nIndex, dwNewLong));
     }
     return(SetWindowLongPtrW(hWnd, nIndex, dwNewLong));
 }
Example #5
0
 public static IntPtr GetWindowLong(IntPtr hWnd, GWL nIndex)
 {
     if (IntPtr.Size == 4)
     {
         return(GetWindowLongW(hWnd, nIndex));
     }
     return(GetWindowLongPtrW(hWnd, nIndex));
 }
        public static int ChangeWindowLong(IntPtr hWnd, GWL nIndex, int mask, int set)     // HELPER!
        {
            int cur = (GetWindowLong(hWnd, nIndex) & ~mask) | set;

            SetWindowLong(hWnd, nIndex, cur);
            //System.Diagnostics.Debug.WriteLine("set exstyle " + cur.ToString("X"));
            return(cur);
        }
Example #7
0
 public static IntPtr SetWindowLongPtr(IntPtr hwnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (8 == IntPtr.Size)
     {
         return(Standard.NativeMethods.SetWindowLongPtr64(hwnd, nIndex, dwNewLong));
     }
     return(new IntPtr(Standard.NativeMethods.SetWindowLongPtr32(hwnd, nIndex, dwNewLong.ToInt32())));
 }
        public static nint GetWindowLong(IntPtr hWnd, GWL nIndex)
        {
            if (!Environment.Is64BitProcess)
            {
                return(GetWindowLongW(hWnd, nIndex));
            }

            return(GetWindowLongPtrW(hWnd, nIndex));
        }
Example #9
0
        public static IntPtr SetWindowLong(IntPtr hWnd, GWL nIndex, nint dwNewLong)
        {
            if (!Environment.Is64BitProcess)
            {
                return(SetWindowLongW(hWnd, nIndex, dwNewLong));
            }

            return(SetWindowLongPtrW(hWnd, nIndex, dwNewLong));
        }
Example #10
0
        internal static IntPtr SetWindowLongPtr(IntPtr hwnd, GWL nIndex, IntPtr dwNewLong)
        {
            if (8 == IntPtr.Size)
            {
                return(SetWindowLongPtr64(hwnd, nIndex, dwNewLong));
            }

            return(new IntPtr(SetWindowLongPtr32(hwnd, nIndex, dwNewLong.ToInt32())));
        }
Example #11
0
        public static IntPtr GetWindowLong(IntPtr hWnd, GWL nIndex)
        {
            if (IsWindowUnicode(hWnd))
            {
                return(GetWindowLongW(hWnd, nIndex));
            }

            return(GetWindowLongA(hWnd, nIndex));
        }
Example #12
0
        // This is aliased as a macro in 32bit Windows.
        public static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
        {
            if (8 == IntPtr.Size)
            {
                return(GetWindowLongPtr64(hwnd, nIndex));
            }

            return(GetWindowLongPtr32(hwnd, nIndex));
        }
Example #13
0
 public static IntPtr SetWindowLongPtr(HWND hwnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (IntPtr.Size == 4)
     {
         // The SetWindowLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return(new IntPtr(SetWindowLong(hwnd, nIndex, dwNewLong.ToInt32())));
     }
     return(_SetWindowLongPtr(hwnd, nIndex, dwNewLong));
 }
Example #14
0
        public static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
        {
            IntPtr zero = IntPtr.Zero;

            zero = (8 != IntPtr.Size ? new IntPtr(Standard.NativeMethods.GetWindowLong(hwnd, nIndex)) : Standard.NativeMethods.GetWindowLongPtr_1(hwnd, nIndex));
            if (IntPtr.Zero == zero)
            {
                throw new Win32Exception();
            }
            return(zero);
        }
Example #15
0
 public static IntPtr SetWindowLongPtr(IntPtr hWnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (Environment.Is64BitProcess)
     {
         return(SetWindowLongPtr64(hWnd, nIndex, dwNewLong));
     }
     else
     {
         return(new IntPtr(SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32())));
     }
 }
Example #16
0
 public static IntPtr GetWindowLongPtr(IntPtr hWnd, GWL nIndex)
 {
     if (Environment.Is64BitProcess)
     {
         return(GetWindowLongPtr64(hWnd, nIndex));
     }
     else
     {
         return(GetWindowLongPtr32(hWnd, nIndex));
     }
 }
Example #17
0
 /// <summary>
 /// Sets the window to <see cref="GWL"/> and <paramref name="style"/> via pointer
 /// </summary>
 /// <param name="hwnd">The HWND.</param>
 /// <param name="gwlIndex">Index of the GWL.</param>
 /// <param name="style">The style.</param>
 internal static IntPtr SetWindowLongPtr(IntPtr hwnd, GWL gwlIndex, IntPtr style)
 {
     if (Environment.Is64BitProcess == true)
     {
         return(SetWindowLongPtr64(hwnd, gwlIndex, style));
     }
     else
     {
         return(new IntPtr(SetWindowLongPtr32(hwnd, gwlIndex, style.ToInt32())));
     }
 }
 // This static method is required because legacy OSes do not support
 // SetWindowLongPtr
 public static IntPtr SetWindowLongPtr(IntPtr hWnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (IntPtr.Size == 8)
     {
         return(SetWindowLongPtr64(hWnd, nIndex, dwNewLong));
     }
     else
     {
         return(new IntPtr(SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32())));
     }
 }
Example #19
0
 // This static method is required because Win32 does not support
 // GetWindowLongPtr directly
 public static IntPtr GetWindowLongPtr(IntPtr hWnd, GWL nIndex)
 {
     if (IntPtr.Size == 8)
     {
         return(GetWindowLongPtr64(hWnd, (int)nIndex));
     }
     else
     {
         return(GetWindowLongPtr32(hWnd, (int)nIndex));
     }
 }
        public static IntPtr GetWindowLongPtr(IntPtr hWnd, GWL nIndex)
        {
            var res = (8 == IntPtr.Size)
                      ? _GetWindowLongPtr64(hWnd, nIndex)
                      : new IntPtr(_GetWindowLong32(hWnd, nIndex));

            if (IntPtr.Zero == res)
            {
                throw new Win32Exception();
            }
            return(res);
        }
Example #21
0
        internal static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
        {
            var ret = 8 == IntPtr.Size
                ? GetWindowLongPtr64(hwnd, nIndex)
                : GetWindowLongPtr32(hwnd, nIndex);

            if (IntPtr.Zero == ret)
            {
                throw new Win32Exception();
            }

            return(ret);
        }
Example #22
0
 public static IntPtr GetWindowLongPtr(HWND hwnd, GWL nIndex)
 {
     if (IntPtr.Size == 4)
     {
         // The SetWindowLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return(new IntPtr(GetWindowLong(hwnd, nIndex)));
     }
     else
     {
         return(_GetWindowLongPtr(hwnd, nIndex));
     }
 }
Example #23
0
        public static IntPtr SetWindowLongPtr64(IntPtr hWnd, GWL nIndex, IntPtr dwNewLong)
        {
            switch (nIndex)
            {
            case GWL.EXSTYLE:
                return(SetWindowExStyle(hWnd, dwNewLong));

            default:
                break;
            }

            NotImplemented(MethodBase.GetCurrentMethod());
            return(IntPtr.Zero);
        }
Example #24
0
        public static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
        {
            IntPtr intPtr = IntPtr.Zero;

            if (8 == IntPtr.Size)
            {
                intPtr = NativeMethodsSetLastError.GetWindowLongPtr(hwnd, (int)nIndex);
            }
            else
            {
                intPtr = new IntPtr(NativeMethodsSetLastError.GetWindowLong(hwnd, (int)nIndex));
            }
            if (IntPtr.Zero == intPtr)
            {
                throw new Win32Exception();
            }
            return(intPtr);
        }
Example #25
0
        public static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
        {
            IntPtr ret = IntPtr.Zero;

            if (8 == IntPtr.Size)
            {
                ret = GetWindowLongPtr64(hwnd, nIndex);
            }
            else
            {
                ret = new IntPtr(GetWindowLongPtr32(hwnd, nIndex));
            }
            if (IntPtr.Zero == ret)
            {
                throw new Win32Exception();
            }
            return(ret);
        }
Example #26
0
        /// <summary>
        /// Gets the pointer to window
        /// </summary>
        /// <param name="hwnd">The HWND.</param>
        /// <param name="gwlIndex">Index of the GWL.</param>
        /// <returns>Pointer to window</returns>
        /// <exception cref="Win32Exception"></exception>
        internal static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL gwlIndex)
        {
            IntPtr ret = IntPtr.Zero;

            if (Environment.Is64BitProcess == true)
            {
                ret = GetWindowLongPtr64(hwnd, gwlIndex);
            }
            else
            {
                ret = new IntPtr(GetWindowLongPtr32(hwnd, gwlIndex));
            }

            if (ret == IntPtr.Zero)
            {
                throw new Win32Exception();
            }

            return(ret);
        }
Example #27
0
        internal static IntPtr GetWindowLongPtr(HandleRef hWnd, GWL nIndex)
        {
            IntPtr zero = IntPtr.Zero;
            int    num  = 0;

            SetLastError(0);
            if (IntPtr.Size == 4)
            {
                int num2 = IntGetWindowLong(hWnd, (int)nIndex);
                num  = Marshal.GetLastWin32Error();
                zero = new IntPtr(num2);
            }
            else
            {
                zero = IntGetWindowLongPtr(hWnd, (int)nIndex);
                num  = Marshal.GetLastWin32Error();
            }
            if (zero == IntPtr.Zero)
            {
            }
            return(zero);
        }
 public static IntPtr SetWindowLongPtr(HWND hwnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (IntPtr.Size == 4) {
         // The SetWindowLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return new IntPtr(SetWindowLong(hwnd, nIndex, dwNewLong.ToInt32()));
     } else {
         return _SetWindowLongPtr(hwnd, nIndex, dwNewLong);
     }
 }
 private static extern int GetWindowLongPtr32(IntPtr hWnd, GWL nIndex);
 public static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
 {
     IntPtr ret = IntPtr.Zero;
     if (8 == IntPtr.Size)
     {
         ret = GetWindowLongPtr64(hwnd, nIndex);
     }
     else
     {
         ret = new IntPtr(GetWindowLongPtr32(hwnd, nIndex));
     }
     if (IntPtr.Zero == ret)
     {
         throw new Win32Exception();
     }
     return ret;
 }
Example #31
0
 public static extern int GetWindowLong(IntPtr hWnd, GWL nIndex);
 internal static IntPtr GetWindowLongPtr(HandleRef hWnd, GWL nIndex)
 {
     IntPtr zero = IntPtr.Zero;
     int num = 0;
     SetLastError(0);
     if (IntPtr.Size == 4)
     {
         int num2 = IntGetWindowLong(hWnd, (int)nIndex);
         num = Marshal.GetLastWin32Error();
         zero = new IntPtr(num2);
     }
     else
     {
         zero = IntGetWindowLongPtr(hWnd, (int)nIndex);
         num = Marshal.GetLastWin32Error();
     }
     if (zero == IntPtr.Zero)
     {
     }
     return zero;
 }
Example #33
0
 public static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
 {
     IntPtr ret = IntPtr.Zero;
     if (8 == IntPtr.Size)
     {
         ret = NativeMethodsSetLastError.GetWindowLongPtr(hwnd, (int)nIndex);
     }
     else
     {
         ret = new IntPtr(NativeMethodsSetLastError.GetWindowLong(hwnd, (int)nIndex));
     }
     if (IntPtr.Zero == ret)
     {
         throw new Win32Exception();
     }
     return ret;
 }
Example #34
0
 public static IntPtr GetWindowLongPtr(IntPtr hwnd, GWL nIndex)
 {
     if (8 == IntPtr.Size)
     {
         return GetWindowLongPtr64(hwnd, nIndex);
     }
     return GetWindowLongPtr32(hwnd, nIndex);
 }
Example #35
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="hwnd"></param>
 /// <param name="index"></param>
 /// <param name="nValue"></param>
 public static void SetWindowLong(IntPtr hwnd, GWL index, int nValue)
 {
     NativeMethods.SetWindowLong(hwnd, index, nValue);
 }
 public static extern WindowStylesEx GetWindowLong(IntPtr hwnd, GWL index);
Example #37
0
 public static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, WS_EX dsNewLong);
Example #38
0
 internal static extern uint SetWindowLong(IntPtr hwnd, GWL nIndex, uint dwNewLong);
 public static extern int GetWindowLong(HWND hwnd, GWL nIndex);
 public static IntPtr GetWindowLongPtr(HWND hwnd, GWL nIndex)
 {
     if (IntPtr.Size == 4) {
         // The SetWindowLongPtr entrypoint may not exist on 32-bit
         // OSes, so use the legacy SetWindowLong function instead.
         return new IntPtr(GetWindowLong(hwnd, nIndex));
     } else {
         return _GetWindowLongPtr(hwnd, nIndex);
     }
 }
 private static extern IntPtr _SetWindowLongPtr(HWND hwnd, GWL nIndex, IntPtr dwNewLong);
 private static extern IntPtr _GetWindowLongPtr(HWND hwnd, GWL nIndex);
Example #43
0
 /// <summary>
 /// Gets a window long pointer.
 /// </summary>
 /// <param name="hWnd">The window handle.</param>
 /// <param name="nIndex">Index of the data to retreive.</param>
 /// <returns>IntPtr of retreived data.</returns>
 public static IntPtr GetWindowLongPtr(IntPtr hWnd, GWL nIndex)
 {
   if (IntPtr.Size == 8)
     return GetWindowLongPtr64(hWnd, nIndex);
   else
     return GetWindowLongPtr32(hWnd, nIndex);
 }
 private static extern int SetWindowLongPtr32(IntPtr hWnd, GWL nIndex, int dwNewLong);
Example #45
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="hwnd"></param>
 /// <param name="index"></param>
 /// <returns></returns>
 public static int GetWindowLong(IntPtr hwnd, GWL index)
 {
     return NativeMethods.GetWindowLong(hwnd, index);
 }
Example #46
0
 internal static extern WS GetWindowLong(IntPtr hWnd, GWL nIndex);
Example #47
0
 public static extern IntPtr SubclassWindow(IntPtr hWnd, GWL nIndex, WindowProcDelegate dwNewLong);
Example #48
0
 internal static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, WS dwNewLong);
Example #49
0
 public static IntPtr SetWindowLongPtr(IntPtr hwnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (8 == IntPtr.Size)
     {
         return NativeMethodsSetLastError.SetWindowLongPtr(hwnd, (int)nIndex, dwNewLong);
     }
     return new IntPtr(NativeMethodsSetLastError.SetWindowLong(hwnd, (int)nIndex, dwNewLong.ToInt32()));
 }
Example #50
0
 public static extern IntPtr SubclassWindow(IntPtr hWnd, GWL nIndex, IntPtr dwNewLong);
Example #51
0
 public static extern IntPtr SetWindowLongPtrW(IntPtr hWnd, GWL nIndex, IntPtr dwNewLong);
Example #52
0
 public static extern int GetWindowLong(IntPtr hWnd, GWL nIndex);
Example #53
0
 public static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, int dwNewLong);
Example #54
0
 public static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, int dwNewLong);
 public static IntPtr SetWindowLongPtr(IntPtr hwnd, GWL nIndex, IntPtr dwNewLong)
 {
     if (8 == IntPtr.Size)
     {
         return SetWindowLongPtr64(hwnd, nIndex, dwNewLong);
     }
     return new IntPtr(SetWindowLongPtr32(hwnd, nIndex, dwNewLong.ToInt32()));
 }
 public static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, WindowStylesEx dwNewLong);
 private static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, GWL nIndex);
 public static extern int SetWindowLong(HWND hwnd, GWL nIndex, int dwNewLong);
 private static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, GWL nIndex, IntPtr dwNewLong);
Example #60
0
 public extern static IntPtr SetWindowLong(IntPtr hwnd, GWL nIndex, IntPtr dwNewLong);