Discussion:
screensaver
(too old to reply)
Michele Simionato
2003-11-06 15:04:07 UTC
Permalink
I would like to disable/enable the screensaver on a Win98 box with a
Python script. Any suggestion? Thanks,

Michele
S***@trisystems.co.uk
2003-11-06 15:20:00 UTC
Permalink
Post by Michele Simionato
I would like to disable/enable the screensaver on a Win98 box with a
Python script. Any suggestion? Thanks,
Not exactly what you want, but it might set you in the right direction...

http://www.brunningonline.net/simon/blog/archives/000562.html

Cheers,
Simon Brunning,
http://www.brunningonline.net/simon/blog/
--LongSig





-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.
Andy Jewell
2003-11-11 18:07:24 UTC
Permalink
Post by Michele Simionato
I would like to disable/enable the screensaver on a Win98 box with a
Python script. Any suggestion? Thanks,
Michele
Michele,

there's probably a switch in the registy... check the MS site for details.
i'm sure you know how to use the _winreg module ;-)

good luck

ps. sorry for the previous blank e-mail - twitchy mouse-finger ;-)

-andyj
Michele Simionato
2003-11-12 07:51:39 UTC
Permalink
Post by Andy Jewell
Post by Michele Simionato
I would like to disable/enable the screensaver on a Win98 box with a
Python script. Any suggestion? Thanks,
Michele
Michele,
there's probably a switch in the registy... check the MS site for details
.
i'm sure you know how to use the winreg module ;-)
good luck
Unfortunately, I am not a Windows person. Actually I mostly use
Windows to
watch DVD's, so I would like to stop the screensaver before watching
the movie and restart it afterward, in an automatic fashion. I looked
at Simon Brunning's script, the meat of it is in the following two
lines:

# set user section of registry.
keyHandle = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER,
'Control Panel\Desktop', 0, win32con.KEY_WRITE)
win32api.RegSetValueEx(keyHandle, 'SCRNSAVE.EXE', 0,
win32con.REG_SZ, saverInstalled)

I have no idea of what it is happening here; I guess the script is
installing
'SCRNSAVE.EXE' whereas I would like to remove it :-(


Michele
Joe Francia
2003-11-12 15:17:35 UTC
Permalink
Post by Michele Simionato
Post by Andy Jewell
Post by Michele Simionato
I would like to disable/enable the screensaver on a Win98 box with a
Python script. Any suggestion? Thanks,
Michele
Michele,
there's probably a switch in the registy... check the MS site for details
.
i'm sure you know how to use the winreg module ;-)
good luck
Unfortunately, I am not a Windows person. Actually I mostly use
Windows to
watch DVD's, so I would like to stop the screensaver before watching
the movie and restart it afterward, in an automatic fashion. I looked
<snip>

Perhaps the DVD software has an option to disable screen saver during
playback?

Peace,
Joe
Thomas Heller
2003-11-12 08:32:58 UTC
Permalink
Post by Michele Simionato
I would like to disable/enable the screensaver on a Win98 box with a
Python script. Any suggestion? Thanks,
Michele
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).

Thomas
Michael Geary
2003-11-12 09:43:31 UTC
Permalink
Post by Thomas Heller
A google search for 'disable screensaver windows' turns up VB code,
-----
import ctypes
SPI_SETSCREENSAVEACTIVE = 17
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
Michele Simionato
2003-11-13 10:02:54 UTC
Permalink
Post by Michael Geary
Post by Thomas Heller
A google search for 'disable screensaver windows' turns up VB code,
-----
import ctypes
SPI_SETSCREENSAVEACTIVE = 17
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
I have just installed ctypes and tried this solution. It works perfectly
well !;)
Thanks to everybody who helped here,

Michele

Loading...