1

I am writing a windows service. I want to do some functions on system start up, system lock, shutdown. How to get the start up,lock and shutdown events in the windows service ?

Arun
  • 3,478
  • 8
  • 33
  • 46
  • 1
    As a startingpoint: http://stackoverflow.com/questions/5202119/detect-shutdown-in-window-service With regard to StartUp: How would that be different from your service being started in the first place? You can't subscribe to events from a systen that is not started. – rene Aug 11 '12 at 12:35

1 Answers1

0

Try with Microsoft.Win32.SystemEvents class.

Khurshid
  • 954
  • 7
  • 19