Screensaver prevention using ctypes cannot be undone

157 Views Asked by At

I created a simple program following the answer here: https://stackoverflow.com/a/63077008, which engages and disengages my screensaver on Win10. It used to work as expected. To allow the screensaver to engage, I'd set the ctypes kernel using this command:

ctypes.windll.kernel32.SetThreadExecutionState(0x80000000)

and would disengage the screensaver using this code:

ctypes.windll.kernel32.SetThreadExecutionState(0x80000002)

As I said, it worked great, and nothing that I know of on my system changed. Now, however, my system is stuck on disengaged screensaver, and though I type in the code for engaging (0x80000000), I cannot get my screensaver to turn back on.

Any thoughts? Thanks in advance.

0

There are 0 best solutions below