A couple of other things you might look at.

  • Does the application you are running support an option to disable the close/exit feature itself?
  • What is the exit value of the application when it terminates normally and when it is manually closed? You may be able to check it and respawn the application.
  • Does the application update files? If the last file which should be updated hasn't been, pop up a message to tell your user not to be so bloody stupid and restart the application.