How to get console's close message?
General and Desktop
3
Posts
2
Posters
1.3k
Views
1
Watching
-
Closing the console window will just kill the process. So, AFAIK, your program won't be able to react on that event. What you can intercept is the "CTRL+C" event. On Windows you need to install a "ConsoleCtrlHandler":http://goo.gl/UQrYcG function. On Linux you need to install a "signal handler":http://www.gnu.org/software/libc/manual/html_node/Signal-Handling.html for the SIGINT signal.