I need to restart my application if an unhandled exception occurs. I'd like to mimic Office applications like Word or even Visual Studio which, when an application crashes or hangs (stops responding), shows a pop-up and asks the user whether he'd like to restart the app or kill it.
I'm not sure how it's done since it's possible that my app has completely and utterly crashes (as explained here). Right now I thinking some form of Watchdog or Launcher app, but my gut tells me that this isn't the way the applications I mentioned do it.
So any light on the "best" or "mostly accepted" way of doing it would be greatly appreciated.
As always, thanks all for the attention.
You could use Windows Error Reporting (WER) to register the application for restart (and even recovery) when it has been running for at least 60 seconds before the unhandled exception occurs.
I haven't tried it, but I've found the following links describing how to do it:
Unfortunately this only seems to work in Windows 7 and above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With