A way is with SetConsoleCtrlHandler
A test (I added different Beeps on Exit... ) =>
I cannot post code again, so a link.. : SetConsoleCtrlHandler Test
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I found few write up for this topic
https://stackoverflow.com/questions/4646827/on-exit-for-a-console-application
https://social.msdn.microsoft.com/Forums/vstudio/en-US/3295e38d-2267-425a-a7f8-9e6035331e53/how-to-capture-closing-of-c-console-apps?forum=csharpgeneral
I want when click on cross button of console window then i want to capture this and fire a mail.
if some one close or kill my console application from TaskBar then also i want to capture this and fire a mail.
How it will be possible? specially i have to capture and fire email when any user kill application from Task Bar window.
Please help me with idea and sample code. thanks
A way is with SetConsoleCtrlHandler
A test (I added different Beeps on Exit... ) =>
I cannot post code again, so a link.. : SetConsoleCtrlHandler Test