onExit() Interrupt project exit

So you want a way to run onExit() and not exit - just ontinue running, when the user tries to quit (or kill?) the process?