title: How to detect wake up from sleep mode in windows service?
body: <p>Good day! I write a windows service, which detects USB Flash drive connection and do something with connected drive. And now after tests i need to reprocess devices after wake up from sleep mode. I solve this problem when service work as windows program. To solve i additionally process <code>DBT_DEVNODES_CHANGED</code>, but service don't receive this message, it receives only <code>DBT_DEVICE_ARRIVAL</code> and <code>DBT_DEVICEREMOVECOMPLETE</code>. I also tried to check all messages handled by service except  <code>SERVICE_CONTROL_DEVICEEVENT</code> and <code>SERVICE_CONTROL_STOP</code> when system is going to sleep and i don't get any message. </p>
  
  <p>How can I determine when the system is waking up?</p>