-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Description
Transfered from MahApps #3852 reported by @DaveSenn
Describe the bug
Making window fullscreen crashes the application when using .NET 5
Steps to reproduce
- Compile any WPF application using MahApps Metro with .NET 5
- Try to make your
MetroWindowfullscreen by clicking the Maximize button in the upper right corner - The application will crash with the following error:
Win32Exception The parameter is incorrect.
Expected behavior
Application should not crash.
Actual behavior
Application crashes. Stacktrace:
System.ComponentModel.Win32Exception
HResult=0x80004005
Message=The parameter is incorrect.
Source=ControlzEx
StackTrace:
at ControlzEx.Standard.NativeMethods.GetMonitorInfoW(IntPtr hMonitor)
at ControlzEx.Behaviors.WindowChromeBehavior._HandleMOVEForRealSize(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at ControlzEx.Behaviors.WindowChromeBehavior.WindowProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
Environment
MahApps.Metro version: v2.0.0
Windows build number: Win10 2004
Visual Studio: 2019 16.6.0
Target Framework: .NET 5 preview 5
Reactions are currently unavailable