When you are on Windows and have a console application running inside the normal console window, and then click on the Close Button ([X]
) this will generate a CTRL_CLOSE_EVENT
.
You can handle these by installing a Console Event Handler with the SetConsoleCtrlHandler
Win32 API function.