Catching the exit event of a simple console application

I have 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.

Answers


You need to use SetConsoleCtrlHandler Windows API function to set your handler.


Need Your Help

How to display the data and stepper in one cell

ios objective-c xcode

when I use this code, but the details are stepper does not work (can be seen in the logs)

Make a thing like lightbow without image inside

javascript html css

is there any way to make a thing like lighbox but don't have pictures in it, just make like text or something?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.