views:

138

answers:

1

I have a console application. In XP, I can use SetConsoleCtrlHandler() to register a callback that receives CTRL_LOGOFF_EVENT, CTRL_C_EVENT and a few others. It works great. When the callback is called I can cleanup before I return from the call. Problem is, SetConsoleCtrlHanlder() is not supported in Vista. Now what?

A: 

SetConsoleCtrlHandler has worked just fine for me on Vista, and there's no indication on its MSDN page that it shouldn't.

Are you having difficulty getting the same code to work on a Vista system? If so, what failure mode / error codes are you seeing?

Reuben