Questions tagged [hibernate-mode]

9 questions
27
votes
6 answers

How can I know when Windows is going into/out of sleep or Hibernate mode?

Is it possible to subscribe to a Windows event that fires when Windows is going into or coming out of Sleep or Hibernate state? I need my application to be made aware when the computer is going to sleep to do some cleanup and avoid timing issues…
Chris Thompson
  • 16,203
  • 9
  • 45
  • 62
17
votes
3 answers

How do I gracefully handle hibernate/sleep modes in a winforms application?

I am writing a windows form application in .net using C#. I am running into a problem that if my program is running when the computer goes into the sleep and/or hibernate state (I am not sure at this time which one, or if both, cause the problem),…
EatATaco
  • 687
  • 7
  • 25
6
votes
5 answers

Can't catch sleep/suspend messages (winXP)

My app needs to block sleep/hibernate mode. I have the code in place, but after successfully catching the WM_POWERBROADCAST message, neither PBT_APMQUERYSUSPEND nor PBT_APMQUERYSTANDBY are being caught successfully. Interestingly, the…
Garrett
  • 1,750
  • 2
  • 16
  • 23
5
votes
2 answers

How to programmatically bring a laptop into Sleep mode

What API or tools can I use to query the capabilities of the system and choose the most appropriate on for putting the PC to Sleep, Hibernate or shutdown mode? Thanks for any pointers.
Renaud Bompuis
  • 16,596
  • 4
  • 56
  • 86
5
votes
1 answer

Chrome / Javascript SetTimeout stuck after computer goes to sleep

I will try to explain ours problem the simpliest possible way. We are facing a tricky bug with our web application + chrome. We have a web page displaying curves, the refresh of the curve is triggered by a setTimeout. If the computer goes to sleep…
2
votes
1 answer

A WPF App fails when coming out of hibernate mode

I have a WPF application that fails to come out of the timed sleep, followed by hibernate. The render thread seems to be failing during initialization. I tried removing hardware acceleration to check that it's not graphics card related, but that did…
Lenik
  • 1,518
  • 1
  • 16
  • 24
1
vote
2 answers

java nio socket not detecting when machine goes to sleep or hibernates

Here are simplified versions of my socket server and client components. The primary goal is for the client to detect when the server goes down and for the server to detect when the client goes down. This works perfectly (on Windows) when either the…
puiuvlad
  • 13
  • 3
0
votes
0 answers

macOS Mojave hibernatemode 25 Dark Wake

I have set hibernate mode to 25 and the standby time to 0 in macOS Mojave. Now my idea is that the Mac goes to deep sleep (no power to RAM). Most of the time it works; if I open the lid I see this screen: Picture: wake up from deep sleep But…
Timo
  • 13
  • 3
0
votes
1 answer

Shellscript: Pmset value as variable in else if script

I'm trying to write a shellscript that will change the hibernation mode from 3 to 25 and vice versa on a Mac. I try to set the result of the "pmset -g | grep hibernatemode" command as the OUTPUT variable (which gives either "hibernatemode 3" or…