1

I am participating in a software development. The original code used .NET's PowerModeChangedEventArgs to determine the power mode modification. This is valid in S3 mode, but we tried to work under S0 and found that it does not trigger this event (It seems that Power mode will not be modified under modern standby?), so I would like to ask if there is any way to judge in the code that it has entered modern standby?

Thanks.

  • At least for Linux there might be a solution: https://stackoverflow.com/questions/14376534/how-to-detect-whether-system-is-going-to-standby-in-linux-using-c – AlexGeorg Feb 21 '20 at 10:11
  • @AlexGeorg how is a _Linux_ sololution in any way relevant here? –  Feb 21 '20 at 10:27
  • @MickyD My bad, I did not notice that the TE implicitly provided the OS by mentioning .NET.. – AlexGeorg Feb 21 '20 at 10:29
  • @AlexGeorg not a problem good sir –  Feb 21 '20 at 10:29
  • @AlexGeorg .NET Core runs on Linux, and macOS, and with some jiggery-pokery on BSD. – Dai Feb 21 '20 at 10:32
  • 1
    I don't know why people voted to close this question - the question seems straightforward to me, and I think there's an answer in this document: https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/prepare-software-for-modern-standby and this document: https://learn.microsoft.com/en-us/windows/compatibility/desktop-activity-moderator – Dai Feb 21 '20 at 10:38
  • I think I've found the answer: you need to pass a callback to `PowerRegisterSuspendResumeNotification` - though I'm unsure what parameters to expect in the callback for an `S0` event in particular. – Dai Feb 21 '20 at 10:41

0 Answers0