SetConsoleCtrlHandler: Restart or Shutdown

T

Thomas Johansen

Hi

I have tried getting my NT service, to see the difference between a restart
and a shutdown.

I have tried using the SetConsoleCtrlHandler().
But it doesn't matter if I restart of shutdown, my handler function allways
recieves the CTRL_SHUTDOWN_EVENT event.

I guess using the RegisterServiceCtrlHandler() function istead has no effect
either. I probely would get the SERVICE_CONTROL_SHUTDOWN event in both the
restart and shutdown case.

I there any other way where I can detect a restart or a shutdown. Perhaps
something I get when the system shuts down and not when its rebooting ??

Any function to call, to se if its a restart or shutdown ??

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top