Click to See Complete Forum and Search --> : Ctrl-Break in Win32 console application


microsin
February 28th, 2006, 05:05 AM
How to trace pressing Ctrl-Break, clicking on close button (in right up corner console window) and change behavior my console in this events (i want make clean up, correct closing application)?

Comments - i make win32 console project in Microsoft Visual C++ 2003 (version 7.1.3088).

RoboTact
February 28th, 2006, 11:26 AM
SetConsoleCtrlHandler (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setconsolectrlhandler.asp)

microsin
March 2nd, 2006, 03:27 AM
Big thanks, Senior RoboTact! It is exactly fit to my task.