Beispiel #1
0
        /// <inheritdoc/>
        public IntPtr GetWindowLongPtr(IntPtr hwnd, GwlType nIndex)
        {
            IntPtr returnValue;

            if (IntPtr.Size == 8)
            {
                // 64 bit system
                returnValue = GetWindowLongPtr64(hwnd, nIndex);
            }
            else
            {
                // 32 bit system
                returnValue = GetWindowLongPtr32(hwnd, nIndex);
            }

            if (returnValue == IntPtr.Zero)
            {
                HResult.ThrowLastError();
            }

            return(returnValue);
        }
Beispiel #2
0
        /// <inheritdoc/>
        public IntPtr SetWindowLongPtr(IntPtr hwnd, GwlType nIndex, IntPtr dwNewLong)
        {
            IntPtr returnValue;

            if (IntPtr.Size == 8)
            {
                // 64 bit system
                returnValue = SetWindowLongPtr64(hwnd, nIndex, dwNewLong);
            }
            else
            {
                // 32 bit system
                returnValue = (IntPtr)SetWindowLongPtr32(hwnd, nIndex, dwNewLong.ToInt32());
            }

            if (returnValue == IntPtr.Zero)
            {
                HResult.ThrowLastError();
            }

            return(returnValue);
        }
Beispiel #3
0
 private static extern IntPtr GetWindowLongPtr64(IntPtr hwnd, GwlType nIndex);
Beispiel #4
0
 private static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, GwlType nIndex, IntPtr dwNewLong);
Beispiel #5
0
 private static extern int SetWindowLongPtr32(IntPtr hWnd, GwlType nIndex, int dwNewLong);