0

I want my application to modify some task during system sleep and awake. i was reading this answer, but but after use that method i could detect power mode change event like enable disable laptop charger but not the system sleep and awake event. is there any another way to do this or i'm missing something in that answer?

sanghmitra
  • 73
  • 7
  • 2
    An application itself will “stop running” when the computer goes to sleep - is that not sufficient for the task? Or: what is the end goal/usage? – user2864740 Jun 25 '20 at 05:44
  • @user2864740 just relate a stopwatch which play and pause by using a button, i want to auto pause it when system goes in sleep mode which required an sleep event to identify status. – sanghmitra Jun 25 '20 at 06:13
  • https://stackoverflow.com/questions/18206183/event-to-detect-system-wake-up-from-sleep-in-c-sharp – Legacy Code Jun 25 '20 at 06:25
  • @LegacyCode Your link is the exact answer OP linked to in the question. – Fildor Jun 25 '20 at 06:28
  • @Fildor ... The answer with 42 ups works though as is... Just tested it. Except he means `Idle` not sleep. Hibernate has also another event, which is not covered by the link. – Legacy Code Jun 25 '20 at 07:33
  • This might be also helpful https://learn.microsoft.com/en-us/windows/win32/power/system-power-states#sleep-state-modern-standby – Legacy Code Jun 25 '20 at 07:35
  • @LegacyCode Ah, now it's clear. :thumbsup: – Fildor Jun 25 '20 at 07:39

0 Answers0