Win32Exception on closing window
See original GitHub issueI have reports of a bug in our app similar to https://github.com/ControlzEx/ControlzEx/issues/13 :
UnhandledException System.ComponentModel.Win32Exception (0x80004005): The parameter is incorrect
at Microsoft.Windows.Shell.WindowChromeWorker._HandleMoveForRealSize(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled) in d:\projects\git\MahApps.Metro\MahApps.Metro\Microsoft.Windows.Shell\WindowChromeWorker.cs:line 1160
at Microsoft.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in d:\projects\git\MahApps.Metro\MahApps.Metro\Microsoft.Windows.Shell\WindowChromeWorker.cs:line 613
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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
@batzen May you write, please, how have you reproduced the bug for the ControlzEx? May the same fix be applied to the MahApps, too? Thanks.
Environment
- MahApps.Metro v1.3.0
- Visual Studio 2015
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
c# - DisplayAlert throws win32 exception after closing new ...
So it seems to be MAUI bug. I use new page instead of new window, that works fine but it's not ideal from...
Read more >Closing multi-window app results in unhandled win32 ...
Run app targeting .net6.0-windows platform · Click on the button multiple times to open multiple windows (say 10 windows) · Start closing the ......
Read more >First chance exception Win32Exception when closing ...
Win32Exception occures in debugging, when new modal window is opened in TableView.RowDoubleClick event and this window is closed by clicking ...
Read more >Error 'An Unhandled win32 exception ERROR' while ...
Everytime I close Microsoft Excel, the Visual Studio Just-In-Time Debugger dialog window pops up with: "An unhandled win32 exception ...
Read more >Win32Exception Class (System.ComponentModel)
Initializes a new instance of the Win32Exception class with the specified detailed description and the specified exception. Properties. Data. Gets a collection ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would like to have full stacktrace, but we use CSharpAnalytics and it’s bug 39 cuts the stacktrace. (We should switch to some other, maintained project.)
Since the source code of MahApps and ControlzEx seems similar to me in the
Microsoft.Windows.Shell
namespace, and I have spotted ControlzEx/ControlzEx#13 and that the fix ControlzEx/ControlzEx@ea4c41c0fdc428269cbea981eedf7a60a836cabd is not in the MahApps, I thought that MahApps contains same bug as ControlzEx before the fix.Now, it seems the bug is not exactly the same, so I will try to get more information about it.
I’ve probably found the problem. We have the
MetroWindow
shown fullscreen without decorations:The user can switch off the fullscreen:
However, during this fullscreen switch off the window is first time a little bit smaller than maximized and in a moment it enlarges to the maximized size. A kind if a transition state. When the user clicks the close button in this transition state, then the exception occurs.