I turn off the monitor using SendMessage(HWND_BROUADCART, WM_SYSCOMMAND, SC_MONITORRPOWER, 2) .
This works, but the monitor turns on again when someone touches the keyboard or mouse. I tried to get rid of this using the DevicePowerSetDeviceState function using DEVICEPOWER_CLEAR_WAKEENABLED for the keyboard and mouse: it does not return errors, but has no effect.
How can I prevent the monitor from turning on in Vista and Windows7?
source share