By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,473 Members | 3,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,473 IT Pros & Developers. It's quick & easy.

screensaver

P: n/a
I would like to disable/enable the screensaver on a Win98 box with a
Python script. Any suggestion? Thanks,

Michele
Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Thursday 06 Nov 2003 3:04 pm, Michele Simionato wrote:
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

Jul 18 '05 #2

P: n/a
Andy Jewell <an**@wild-flower.co.uk> wrote in message news:<ma************************************@pytho n.org>...
On Thursday 06 Nov 2003 3:04 pm, Michele Simionato wrote:
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
Jul 18 '05 #3

P: n/a
mi**@pitt.edu (Michele Simionato) writes:
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
Jul 18 '05 #4

P: n/a
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
Jul 18 '05 #5

P: n/a
Michele Simionato wrote:
Andy Jewell <an**@wild-flower.co.uk> wrote in message news:<ma************************************@pytho n.org>...
On Thursday 06 Nov 2003 3:04 pm, Michele Simionato wrote:
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
Jul 18 '05 #6

P: n/a
"Michael Geary" <Mi**@DeleteThis.Geary.com> wrote in message news:<vr************@corp.supernews.com>...
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


I have just installed ctypes and tried this solution. It works perfectly
well !;)
Thanks to everybody who helped here,

Michele
Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.