title: SystemEvents.PowerModeChanged not raising Resume events
body: <p>I have an WinForms application that keeps track when system enters suspended state (sleep) and when it resumes. App uses the <code>SystemEvents</code> class for this purpose. It works fine on my machine. However it seems that for some users the event with <code>PowerModes.Resume</code> is not always raised. App recieves multiple <code>PowerModes.Suspend</code> without any <code>PowerModes.Resume</code> in between which is strange.</p>
  
  <p>My primary question is how that could possibly happen and how to avoid it and make resume detection reliable?</p>
  
  <p>The code is pretty straightforward and is basically following (very shortened):</p>
  
  <pre><code>Imports Microsoft.Win32
  
  
  Friend Class TehClass
      Implements IDisposable
  
  
      Private Sub New()
          AddHandler SystemEvents.PowerModeChanged, AddressOf Me.System_PowerModeChanged
      End Sub
  
  
      Private Sub System_PowerModeChanged(sender As Object, args As PowerModeChangedEventArgs)
          Log.Info("Power mode changed: {0}.", args.Mode)
      End Sub
  
  #Region "IDisposable Support"
      ' just dropping handler there
  #End Region
  
  End Class
  </code></pre>
  
  <p>There is an existing form within app all the time. However it could be minimized or hidden in the notification area. Also there is kept reference to the actual instance of the <code>TehClass</code>.</p>
  
  <p>This is the sample log:</p>
  
  <pre><code>[2015-09-15 22:38:38,501] Power mode changed: Suspend.
  [2015-09-16 07:10:31,106] Power mode changed: Resume.
  [2015-09-16 08:54:21,112] Power mode changed: Suspend.
  [2015-09-16 09:14:36,252] Power mode changed: Suspend.
  [2015-09-16 09:35:21,077] Power mode changed: Suspend.
  [2015-09-16 09:55:36,085] Power mode changed: Suspend.
  [2015-09-16 10:15:50.122] User reported this log therefore the PC had to be in Working (Resumed) state.
  </code></pre>
  
  <p>What I notice from the log is that there actually was Resume event raised for the first time. Another thing is that suspend got invoked in roughly 20 minutes intervals. Could it be some kind of "computer just partially wakes-up without actually turning monitor on or so and lets apps to process whatever they need to /network notifications, etc./ and than is put into sleep again" stuff?</p>