is there any way to disable a loop when the user is inactive / when the screen saver is on?

Recommended Answers

All 2 Replies

On MS-Windows there is a system window message that you can process to indicate that you don't want the screensaver to become active. You can use it to monitor when the screensaver gets active. You must be in a GUI program, from a commandline python program it does not work.

But why not sleep() a while during the loop, this will prevent from using 100%CPU

On MS-Windows there is a system window message that you can process to indicate that you don't want the screensaver to become active. You can use it to monitor when the screensaver gets active. You must be in a GUI program, from a commandline python program it does not work.

But why not sleep() a while during the loop, this will prevent from using 100%CPU

ok so i found this code

SystemParametersInfo(SPI_GETSCREENSAVEACTIVE,0,tru e,0);

how do i use it what win32 module do i need to use

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.