Is it Possible to Handle Shutdown or Restart Windows?
Hello Gurus,
I have a Strange Problem. I am updating a counter on the disk by doing a Write to the Disk from a Windows Service in VC++ and i need to handle the case when the user restarts or shuts down the system. This is because sometimes shutdown screws up the counter value. So if i am able to handle shutdown or restart windows from Service i can do the necessary clean up in the Service and then exit the service and let the shutdown or restart to proceed.
Is it possible to do that?
Thank you
Kandukondein
Re: Is it Possible to Handle Shutdown or Restart Windows?
I guess if it is a service you don't have any window (you don't get the WM_QUERYENDSESSION message if you don't process them "manually"). However this article may help you in the case of a service.
For the Restart since it is a service you know when it is starting...
Re: Is it Possible to Handle Shutdown or Restart Windows?
you can also read this Thread
Cheers
Re: Is it Possible to Handle Shutdown or Restart Windows?
If I have correctly read, the OP refers to a service.
Because I'm not so experimented in this domain I just can suggest to search MSDN for SERVICE_CONTROL_SHUTDOWN.
One link may be THIS.