How to identify that user has terminated the program
I am using visual studio 2005 .
The following code works fine if there is a abort internal to the program.
I want to know is there any API or signal by using which I can know that user of the program has abnormally terminated the program.
Case 1: The user clicks the close button of the IDE.
Case 2: The user uses the Stop Debugging button to kill the process.
void SignalHandler(int signal)
int i = 100;
typedef void (*SignalHandlerPointer)(int);
previousHandler = signal(SIGABRT, SignalHandler);