
I have already found out, that I probably need to check the Windows Message Loop of my MainWindow for some WM_SYSCOMMAND with wparam SC_CLOSE. If yes, all windows should close silently, otherwise stay open.īut my MainWindow is not the first one, to process the closing procedure. What I want is: If the MainWindow is asked for closing, I want to prompt once, if that's ok. This is annoying and confusing if there are many of those. Some of my windows may ask before closing, if it's okay to cancel pending changes. If it is clicked, each Window of my application gets an individual close-command in an order I cannot control.


If these windows get grouped in the taskbar, windows will provide the action "Close all Windows" in the taskbar context menu. there is always one MainWindow and optionally many others with no owner. I have a WPF-application with multiple unrelated Windows, i.e.
