Catching the exit event of a simple console application
I hav开发者_JS百科e this simple console application in Delphi 2010 and I would like it to do something (run a piece of code) when I press the "X" button (when I close it), however I can't seem to find how to assign a close event to it. Neep help, thanks.
You need to use SetConsoleCtrlHandler Windows API function to set your handler.
精彩评论