Exemple #1
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())));
 }
        public static int GetKeyboardLayoutList(int size, [Out, MarshalAs(UnmanagedType.LPArray)] IntPtr[] hkls)
        {
            int result = NativeMethodsSetLastError.GetKeyboardLayoutList(size, hkls);

            if (result == 0)
            {
                int win32Err = Marshal.GetLastWin32Error();
                if (win32Err != 0)
                {
                    throw new Win32Exception(win32Err);
                }
            }

            return(result);
        }
Exemple #3
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);
        }