title: Detect Connected Standby Sleep without Win8 Specific API
body: <p>Hopefully the answer to this isn't just "not possible", but it may be.</p>
  
  <p>I have a program that supports Windows Vista and above that monitors the WM_POWERBROADCAST message for PBT_APMSUSPEND. When it gets this message it means that the computer is going into sleep mode, so it quickly does some things and pauses itself and then resumes once it gets a PBT_APMRESUMESUSPEND message. </p>
  
  <p>This doesn't seem work on windows 8 machines that use the <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/dn481238(v=vs.85).aspx" rel="nofollow" title="connected standby">connected standby</a> feature. According to <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh848040(v=vs.85).aspx" rel="nofollow" title="DAM documentation">this link</a>, when connected standby is enabled you need to opt in to receiving the WM_POWERBROADCAST messages. It then links to <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/jj613321(v=vs.85).aspx" rel="nofollow" title="RegisterSuspendResumeNotification">the RegisterSuspendResumeNotification function</a> to use to register for this message.</p>
  
  <p>The problem is, RegisterSuspendResumeNotification seems to require Win 8+. I would really like a way to have one program support vista and above still, and would rather not have to make a windows 8 version, and an "everything else" version. Does anyone know if there's some other API that does a similar thing? Or perhaps if there's some other clever way to get that the computer is entering connected standby without getting the WM_POWERBROADCAST message?</p>
  
  <p>Thanks for the help.</p>