954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

disable loop when inactive

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

alex-VX
Light Poster
27 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

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

djidjadji
Light Poster
28 posts since Aug 2009
Reputation Points: 38
Solved Threads: 18
 

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

alex-VX
Light Poster
27 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: