mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
26 lines
1.1 KiB
C#
26 lines
1.1 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using ManagedWinapi.Windows;
|
|
|
|
namespace Ninjacrab.PersistentWindows.WpfShell.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 SetWindowPlacement(IntPtr hWnd, [In] ref WindowPlacement lpwndpl);
|
|
}
|
|
}
|