I\'m writting a console application in C++.
I use SetConsoleCtrlHandler to trap close and CTRL+C button. This allows for all my threads to stop and exit properly.
I suspect that this is by-design on Windows 7 - if the user wants to quit your application, you're not allowed to tell him "No".