-2

Java program halts execution when my computer is locked under my login. Locked does not mean locked up, like a Blue Screen of Death (BSoD).

How to continue execution when PC is locked?

jww
  • 97,681
  • 90
  • 411
  • 885
  • 3
    Locked as in...frozen? BSoD? Not responsive? [Could you provide a little more context, please?](http://meta.stackexchange.com/a/128551/175248) – Makoto Jun 19 '12 at 04:44
  • 1
    Is this Lock in Windows? – nhahtdh Jun 19 '12 at 04:46
  • 1
    I believe locked as in (for example in Windows 7), you go to the start menu, press the tab beside shut down, and press lock (under log off). Or when your computer is idle for a long period, it will automatically "sleep" and lock itself for security. – Kurty Jun 19 '12 at 05:18

1 Answers1

2

If your screen merely is locked, background processes will continue to run. However, if your PC is set to sleep or hibernate after a certain delay the when it enters sleep or hibernate mode all activity stops. The only way to prevent sleep/hibernate is to disable them yourself manually in the power profile Control Panel applet.

There may be a programmatic API for this that you could call from your program via JNI. You can find that in the Microsoft MSDN documentation.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190