Restart application on crash

I need to restart the application if an unhandled exception occurs. I would like to simulate Office applications, such as Word or even Visual Studio, which, when the application crashes or freezes (stops responding), displays a pop-up window and asks the user if he needs to restart the application or kill it.

I am not sure how this was done, as it is possible that my application worked completely and completely (as explained here ). Right now I am thinking of some form of Watchdog or Launcher, but my gut tells me that this is not how the applications I talked about do.

Therefore, any light on the “best” or “mostly accepted” way of doing this would be greatly appreciated.

As always, thank you for your attention.

+6
source share
1 answer

You can use Windows Error Reporting (WER) to register the application for restart (and even recovery) when it was launched at least 60 seconds before an unhandled exception occurred.

I have not tried, but found the following links describing how to do this:

Unfortunately, this only works on Windows 7 and above.

+3
source

Source: https://habr.com/ru/post/914367/


All Articles