Hello. There is a console program. How do I intercept the event of closure and perform some action on the freeing of resources? Interception SIGINT does not work. Messages from log: 2016-05-29 11:27:56 - Send SIGINT 8368 2016-05-29 11:27:56 - SIGINT to 8368 failed - Killing as fallback I think problem in 'AttachConsole'. OS: Windows 10 x64