screensaver

  • Thread starter Michele Simionato
  • Start date
M

Michele Simionato

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

Michele
 
A

Andy Jewell

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
 
M

Michele Simionato

Andy Jewell said:
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
 
T

Thomas Heller

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
 
M

Michael Geary

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)

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
 
J

Joe Francia

Michele said:
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
 
M

Michele Simionato

Michael Geary said:
Thomas Heller:

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Java Screensaver 0
Java Screensaver 0
Java Screensaver 0
Java Screensaver 0
Making a Screensaver with Java 3
Java Screensaver 0
screensaver in Python 3
Java Screensaver 0

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,920
Members
47,464
Latest member
Bobbylenly

Latest Threads

Top