How do you turn on and off a monitor from within a Java application?
In case you\'re wondering why, this is a kiosk style application where it would be great to turn
Assuming you deploy your Java Applications on Windows, you can use this WIN32API functions:
// turn off monitor
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
// turn on monitor
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1);
Then you write a little C-JNI wrapper to functions that call the mentioned SendMessage
and use the little wrapper to turn off the monitor from Java.