I have a Java program that continuously runs with the command prompt open. Now, if the user tries to exit the program either by pressing CTRL + C or by clicking on the close button, I want to display a confirmation if they really want to close.
If it is not possible using Java or batch, Any other way of doing it without using them?