I'm attempting to keep the system on while allowing the display to power off, to allow a download to finish while the system is unattended. To achieve this I call:
SetThreadExecutionState(ES_SYSTEM_REQUIRED);
whenever I get data from the download. However, this seems to prevent display power down as well (the display dims per its configured dimming timer, but never completely turns off). According to the MSDN entry, this should only happen if I also pass ES_DISPLAY_REQUIRED
- why is it being blocked anyway?
Note that when I stop calling SetThreadExecutionState
, the display does not start powering off again; I have to terminate the program to allow the display to turn off. However, shouldn't it only have persistent effects if called with ES_CONTINUOUS
?
I'm using Windows 7, if it matters. I'm unable to test on other versions at this time...