Hi
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.
Code:
void SignalHandler(int signal)
{
do{
printf("Application aborting...\n");
}while(1);
}
int main()
{
int i = 100;
typedef void (*SignalHandlerPointer)(int);
SignalHandlerPointer previousHandler;
previousHandler = signal(SIGABRT, SignalHandler);
abort();
}