mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 13:05:38 +02:00
39 lines
1.6 KiB
C#
39 lines
1.6 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using ManagedWinapi.Windows;
|
|
|
|
namespace Ninjacrab.PersistentWindows.Common.WinApiBridge
|
|
{
|
|
public class User32
|
|
{
|
|
#region EnumDisplayMonitors
|
|
public delegate bool MonitorEnumDelegate(IntPtr hMonitor, IntPtr hdcMonitor, ref RECT lprcMonitor, IntPtr dwData);
|
|
[DllImport("user32.dll")]
|
|
public static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr lprcClip, MonitorEnumDelegate lpfnEnum, IntPtr dwData);
|
|
#endregion
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
|
public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MonitorInfo lpmi);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
public static extern bool GetWindowPlacement(IntPtr hWnd, ref WindowPlacement lpwndpl);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
public static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WindowPlacement lpwndpl);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
public static extern bool IsWindow(IntPtr hWnd);
|
|
|
|
#region Hooks
|
|
[DllImport("user32.dll")]
|
|
public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
|
|
#endregion
|
|
}
|
|
}
|