Windows: OnStart, OnStop, OnPause, OnContinue



  • I have a service working under LocalSystem. OnStart works when OS is launched, OnStop when it's off. Why do you want OnPause and OnContinue? And what happens to the service when I go to sleep or hybrid mode?



  • OnStart works when OS is launched, OnStop when it's off.

    You have an incorrect understanding of the principles of service. Actually, OnStart It works when the service starts, OnStop - when it stops.

    Now, the start and the stops of service are happening at the start of the LO and when the switch is off. But that's only what happens if the service's on an automatic launch, but it's also a manual one, in which case the service won't start at the start of the OS.

    Starting with Windows 8, there's a contribution to the management of the services. Any service (including those for automatic launch) may be started or stopped. In the oldest versions of the vinda, it can be done through the back of the service desk. In the same backbone, the start-up mode can be changed.

    OnPause and OnContinue when the service is suspended and resumed. These operations are performed manually, as are the launch/ostane (yes or other programmes). OnPause You can be seen as athem, but not the end. These two service operations are accessible if the service is marked as supporting the suspension (management) CanPauseAndContinue installed true)

    There is nothing going on in a sleeping mode with a service - it continues to work just like all other programmes. But if you have to do something special about this case, it's a characteristic. CanHandlePowerEvent and event OnPowerEvent Help you.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2