Search code examples
javamonitorenergysmart

autmatic turnng off of the monitor when computer is locked


I want to write a program in java such that as soon as the computer is locked by pressing (ALT +CTR+DEL -> lock comp ) the monitor becomes off.I want to implement this is java.

Also when user presses any key of keyboard the monitor shold be on.

How can i do this?

I want to save the electricity by doing this and make save environment.


Solution

  • As others said, don't use Java.

    If you use Windows, you might want to have a look at the monitor off and lockws commands of NirCmd.