Comment 3 for bug 434476

Revision history for this message
In , Sylvain Pasche (sylvain-pasche) wrote :

Er, yeah the documentation is right. Calling SetThreadExecutionState(ES_DISPLAY_REQUIRED) just resets the idle idle timer, so it would need to be called regularly.

Python testcase:
import ctypes, time
while True:
    ctypes.windll.kernel32.SetThreadExecutionState(0x00000002)
    time.sleep(10)