Example #1
0
        /// <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));
        }
Example #2
0
        /// <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));
        }
Example #3
0
 /// <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());
     }
 }
Example #4
0
 // 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));
     }
 }
Example #5
0
 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));
     }
 }
Example #6
0
        /// <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);
        }
Example #7
0
 public static extern WindowStyleFlags SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex,
     WindowStyleFlags dwNewLong);
Example #8
0
 private static extern WindowStyleFlags GetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex);
Example #9
0
    public static uint GetWindowLongPtr(IntPtr handle, WindowLongIndex nIndex)
    {
        var rVal = (uint)(Platform.Is64Bit ? (uint)GetWindowLongPtr64(handle, nIndex).ToInt32() : GetWindowLongPtr32(handle, nIndex));

        return(rVal);
    }
Example #10
0
 public static IntPtr GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex)
 {
     return IntPtr.Size == 4 ? NativeMethods.GetWindowLong32(hWnd, (int)nIndex) : NativeMethods.GetWindowLongPtr64(hWnd, (int)nIndex);
 }
Example #11
0
 public static WindowStyle GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex)
 {
     return(IntPtr.Size == 8 ? GetWindowLong64(hWnd, nIndex) : GetWindowLong32(hWnd, nIndex));
 }
Example #12
0
        /// <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);
        }
Example #13
0
 internal static extern WindowStyles SetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex, WindowStyles dwNewLong);
Example #14
0
 private static extern WindowStyle SetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex, WindowStyle dwNewLong);
Example #15
0
        /// <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);
        }
Example #16
0
 static extern uint GetWindowLong(IntPtr handle, WindowLongIndex index);
Example #17
0
 private static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, WindowLongIndex nIndex);
Example #18
0
 public static int SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, int newValue)
 {
     return(Win32API.SetWindowLong(hWnd, (short)nIndex, newValue));
 }
Example #19
0
 public static int GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex)
 {
     return(Win32API.GetWindowLong(hWnd, (short)nIndex));
 }
Example #20
0
 public static extern int SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStylesEx dwNewLong);
Example #21
0
 internal static extern WindowStyles GetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex);
Example #22
0
 private static extern WindowStyle GetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex);
Example #23
0
 static extern uint GetWindowLongPtr32(IntPtr handle, WindowLongIndex nIndex);
Example #24
0
 public static WindowStyle SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStyle dwNewLong)
 {
     return(IntPtr.Size == 8 ? SetWindowLong64(hWnd, nIndex, dwNewLong) : SetWindowLong32(hWnd, nIndex, dwNewLong));
 }
Example #25
0
 static extern IntPtr GetWindowLongPtr64(IntPtr handle, WindowLongIndex nIndex);
Example #26
0
 public static extern IntPtr SetWindowLong(IntPtr hwnd, WindowLongIndex index, IntPtr handle);
Example #27
0
 private static extern WindowStyleFlags SetWindowLong64(IntPtr hWnd, WindowLongIndex nIndex, WindowStyleFlags dwNewLong);
Example #28
0
 static extern uint SetWindowLongPtr32(IntPtr handle, WindowLongIndex nIndex, uint newLong);
Example #29
0
 public static extern int GetWindowLongPtr(IntPtr hwnd, WindowLongIndex nIndex);
Example #30
0
 static extern IntPtr SetWindowLongPtr64(IntPtr handle, WindowLongIndex nIndex, IntPtr newLong);
Example #31
0
 private static extern WindowStyleFlags GetWindowLong32(IntPtr hWnd, WindowLongIndex nIndex);
Example #32
0
    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);
    }
Example #33
0
 public static extern IntPtr SetWindowLongPtr(IntPtr hWnd, WindowLongIndex nIndex, uint value);
Example #34
0
 public static extern WindowStyleFlags GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex);
Example #35
0
 private static extern WindowStyleFlags SetWindowLong32(IntPtr hWnd, WindowLongIndex nIndex,
                                                        WindowStyleFlags dwNewLong);
Example #36
0
 public static extern WindowStylesEx GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex);
Example #37
0
 public static extern int SetWindowLong(IntPtr hWnd, WindowLongIndex index, int dwNewLong);