|
|
@ -987,7 +987,7 @@ namespace Avalonia.Win32.Interop |
|
|
|
|
|
|
|
|
[DllImport("user32", EntryPoint = "GetMonitorInfoW", ExactSpelling = true, CharSet = CharSet.Unicode)] |
|
|
[DllImport("user32", EntryPoint = "GetMonitorInfoW", ExactSpelling = true, CharSet = CharSet.Unicode)] |
|
|
[return: MarshalAs(UnmanagedType.Bool)] |
|
|
[return: MarshalAs(UnmanagedType.Bool)] |
|
|
public static extern bool GetMonitorInfo([In] IntPtr hMonitor, [Out] MONITORINFO lpmi); |
|
|
public static extern bool GetMonitorInfo([In] IntPtr hMonitor, ref MONITORINFO lpmi); |
|
|
|
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)] |
|
|
[return: MarshalAs(UnmanagedType.Bool)] |
|
|
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "PostMessageW")] |
|
|
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "PostMessageW")] |
|
|
@ -1055,12 +1055,17 @@ namespace Avalonia.Win32.Interop |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)] |
|
|
[StructLayout(LayoutKind.Sequential)] |
|
|
internal class MONITORINFO |
|
|
internal struct MONITORINFO |
|
|
{ |
|
|
{ |
|
|
public int cbSize = Marshal.SizeOf<MONITORINFO>(); |
|
|
public int cbSize; |
|
|
public RECT rcMonitor = new RECT(); |
|
|
public RECT rcMonitor; |
|
|
public RECT rcWork = new RECT(); |
|
|
public RECT rcWork; |
|
|
public int dwFlags = 0; |
|
|
public int dwFlags; |
|
|
|
|
|
|
|
|
|
|
|
public static MONITORINFO Create() |
|
|
|
|
|
{ |
|
|
|
|
|
return new MONITORINFO() { cbSize = Marshal.SizeOf<MONITORINFO>() }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public enum MonitorOptions : uint |
|
|
public enum MonitorOptions : uint |
|
|
{ |
|
|
{ |
|
|
|