Capturing events in Windows Service

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • j0hnb
    New Member
    • Apr 2008
    • 2

    Capturing events in Windows Service

    Hello,

    I have been experimenting with windows services using Visual Studio.NET 2003. I used the Windows Template that it provides in the projects and it was really simple to create a windows service in no time at all.

    I would like to be able to receive some windows messages such as SERVICE_CONTROL _SHUTDOWN so that I know the computer is shutting down. I know that there is a 'CanShutdown' option in the template that allows me to be notified of the mahcine closing down but it happens late on and I cannot stop the machine from closing down. I read that it is possible to stop a shutdown but I can't figure out how to do it when using c++ in the .NET template.

    Can anyone provide me with some help in this matter?

    Regards,

    John.
Working...