title: Automatically pausing/continuing a service when OS suspends
body: <p>I made a Windows Service process that can be started/stopped/paused/continued.</p>
  <p>The service is created with <code>CreateService()</code> and the service starts a service controller with <code>RegisterServiceCtrlHandlerExA()</code>.</p>
  <p>Even though the service can subscribe to power setting notifications using <code>RegisterPowerSettingNotification()</code> I find that these only represent events like battery/mains for laptops, and such. Not for suspend/sleep of the OS.</p>
  <p>How can I tell the SCM to automatically pause my service before the OS suspends/sleeps? And continue my service after it wakes up again?</p>