I am developing c++ command line project in visual studio. I need to capture application closing event (closing application with CTRL+Z or closing command line window while running the application).
My App look like:
int main()
{
//crete app object, will open some files and run the code.
myApp app;
app.run();
getchar();
}
If I close the application explicitly as I mentioned above, myApp destructor will not be executing. so I need some way to capture this closing event in my application (Like QObject::closeEvent() in Qt).
Thanks in advance.