Browse Source

pass MONITORINFO as ref

pull/1953/head
ahopper 8 years ago
parent
commit
5786d51853
  1. 2
      src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs
  2. 2
      src/Windows/Avalonia.Win32/ScreenImpl.cs
  3. 2
      src/Windows/Avalonia.Win32/WindowImpl.cs

2
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs

@ -987,7 +987,7 @@ namespace Avalonia.Win32.Interop
[DllImport("user32", EntryPoint = "GetMonitorInfoW", ExactSpelling = true, CharSet = CharSet.Unicode)]
[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)]
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "PostMessageW")]

2
src/Windows/Avalonia.Win32/ScreenImpl.cs

@ -27,7 +27,7 @@ namespace Avalonia.Win32
(IntPtr monitor, IntPtr hdcMonitor, ref Rect lprcMonitor, IntPtr data) =>
{
MONITORINFO monitorInfo = MONITORINFO.NewMONITORINFO();
if (GetMonitorInfo(monitor, monitorInfo))
if (GetMonitorInfo(monitor,ref monitorInfo))
{
RECT bounds = monitorInfo.rcMonitor;
RECT workingArea = monitorInfo.rcWork;

2
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -839,7 +839,7 @@ namespace Avalonia.Win32
{
MONITORINFO monitorInfo = MONITORINFO.NewMONITORINFO();
if (GetMonitorInfo(monitor, monitorInfo))
if (GetMonitorInfo(monitor,ref monitorInfo))
{
RECT rcMonitorArea = monitorInfo.rcMonitor;

Loading…
Cancel
Save