Michele
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.
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
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
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
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
Perhaps the DVD software has an option to disable screen saver during
playback?
Peace,
Joe
I have just installed ctypes and tried this solution. It works perfectly
well !;)
Thanks to everybody who helped here,
Michele