Re: screensaver
From: Michael Geary (Mike_at_DeleteThis.Geary.com)
Date: 11/12/03
- Next message: Idar: "Re: Conversion of 24bit binary to int"
- Previous message: Alex Martelli: "Re: Custom exceptions -- inherit from exceptions.Exception?"
- In reply to: Thomas Heller: "Re: screensaver"
- Next in thread: Michele Simionato: "Re: screensaver"
- Reply: Michele Simionato: "Re: screensaver"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 12 Nov 2003 01:43:31 -0800
Thomas Heller:
> A google search for 'disable screensaver windows' turns up VB code,
> which easily translates into this Python code:
>
> -----
> import ctypes
> SPI_SETSCREENSAVEACTIVE = 17
>
> def StartScreenSaver(on):
> ctypes.windll.user32.SystemParametersInfoA(
> SPI_SETSCREENSAVEACTIVE, on, None, 0)
>
> StartScreenSaver(1)
> -----
>
> Unfortunately, it doesn't seem to work (for me, on XP. At least it has
> no visible effect).
Your StartScreenSaver() function should probably be called
EnableScreenSaver(). Call it with a 0 parameter to disable the screen saver,
or 1 to enable it.
The function won't have any immediate visible effect--it simply enables or
disables the screen saver, it doesn't start or stop it.
Try setting your screen saver timeout to one minute. Let the computer sit
for a minute to verify that the screen saver is working. Then call
EnableScreenSaver(0) to disable the screen saver, and let the computer sit
for a minute again to see if you've disabled it.
-Mike
- Next message: Idar: "Re: Conversion of 24bit binary to int"
- Previous message: Alex Martelli: "Re: Custom exceptions -- inherit from exceptions.Exception?"
- In reply to: Thomas Heller: "Re: screensaver"
- Next in thread: Michele Simionato: "Re: screensaver"
- Reply: Michele Simionato: "Re: screensaver"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|