Are there best practices and code snippets available which show how I can handle Ctrl+C in a Delphi console application?
I have found some articles which give some information about possible problems with the debugger, with exception handling, unloading of DLLs, closing of stdin, and finalization for example this CodeGear forums thread.
From Windows API (MSDN):
A HandlerRoutine function is a function that a console process specifies to handle control signals received by the process. The function can have any name.
In the Delphi the handler routine should be like: