473,775 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simulate Mouse/Keyboard to stop Screen Saver

Greetings,

I have a very simple question. How do you simulate a user input to
turn off a screen saver in Windows (either a mouse movement, mouse
click, or keyboard input)? I promise I searched the newsgroup before
asking :)

I have written the following program that loads all my Webshots files
into the Webshots photo manager, or so I thought. When you load the
first it starts the screen saver. All other subsequent ones are not
loaded into the system, unless you sit there and move the mouse. This
stops the screen saver and when the sleep stops the next one is
started.

import os
import re
import time
Directory = "d:/download/webshots/2003-08/"
FileList = os.listdir(Dire ctory)
FileList.sort()
Count = 0
for FileName in FileList:
CompleteFileNam e = Directory + FileName
print "Executing FileName = " +CompleteFileNa me
os.startfile(Co mpleteFileName)
Count = Count + 1
time.sleep(5)
print str(Count)+ " files executed"

Since I have approximately 2 photos a day from 1998 on I really don't
want to do this manually.

Thank you
Jul 18 '05 #1
1 12241
> I have a very simple question. How do you simulate a user input to
turn off a screen saver in Windows (either a mouse movement, mouse
click, or keyboard input)? I promise I searched the newsgroup before
asking :)


Maybe somebody will know the answer, but in the meantime you can be
searching on how to do this from C or VisualBasic - IOW you can be searching
MSDN or some other Windows-specific resource. Once you know how to do it
from one of those languages it'll be trivial to do it from Python. I guess
I'm saying that, since it's such a Windows-specific question, you might want
to make sure your search is broader than Python users who have done the same
thing in the past - which is what you get by polling c.l.py.

FWIW I seem to remember some Windows API for disabling the screensaver
altogether (as in, turn off the show-screensaver-after-so-many-minutes
functionality), so you could call that at the beginning of your processing
and then turn it back on at the end. This would probably work better than
simulating mouse/keyboard input.

Good luck!
Dave
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1996
by: Per Larsson | last post by:
Hi! I've developed an application, and I want to use a semi opac form to show the help. The idea is to show the transparent help form on top (TopMost = True)and still be able to work with the application underneath. By setting CausesValidation = False, it ignores keyboard action so thats OK, but it still hooks the mouse clicks. Does anybody know how to disasble the mouse hook in the form? (Or other work around?) Have messed around with...
0
1491
by: Mythran | last post by:
I'm trying to create a library that will 1.) Simulate an input device (IE: keyboard, mouse, joystick) and 2.) Capture data sent from an input device (IE: keyboard, mouse, joystick). The reason's for this are to be able to control (1) which will prevent specific (2) from being done. Effectively locking down operating systems in production environments. I do know that the different versions of MS Windows can lock themselves down to...
4
8844
by: Henry Wu | last post by:
Hi, I see examples of Magnifying an area under mouse coordinates to a form or picturebox using VB6 and VC6, does anyone know how to do it under VB.NET? Its nice to use the new GDI+ for it. Thanks, Henry
0
3283
by: Jeffery Tyree | last post by:
I have a machine that will be used to demo some Excel spreadsheets at a convention. Because I did not author the spreadsheets and attendees will be allowed to play with the spreadsheets, I needed a way to periodically restore the original versions. In addition to the "always-on-top click this button to reset demo" application I wrote, I chose to use screen saver code to reset the demo after a period of inactivity in the event an attendee...
3
2297
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data using data in this row before actually remove it from datagrid. I can certainly control with Delete button. But if I want to allow the user to use Del key on the keyboard, I lost this kind control.
4
7516
by: flplini | last post by:
I want to ask how to use C++ to simulate the mouse control? ex:Let the mouse double-click the left key functions,thanks!
18
22115
by: eliss.carmine | last post by:
Is it possible to simulate a mouse click in the window I made (it's a Form), but not give it focus? I tried using WinAPI's mouseevent and SendMessage of WM_LBUTTONDOWN/WM_LBUTTONUP as suggested by the folks in #winapi on EFnet, but I think those require the window to have focus. Either that, or I'm doing something else wrong. The click actually seems to work once, and then stops working... I have no idea what is the problem actually....
1
4631
by: =?Utf-8?B?aG9tYW50Y3c=?= | last post by:
-windows xp -dell dimension 9150 The computer starts normally, loads up the blue login screen. I can move the cursor around the screen and type on keyboard. Then after roughly 3 seconds (always this amount of time) the cursor freezes, the mouse inoperable and the keyboard locks up at the same time (num lock light goes out). I have to manually restart.
3
8440
by: =?Utf-8?B?cHJvZ2dlcg==?= | last post by:
I have a C# application that hosts an AxWebBrowser control which I automate by sending mouse clicks and keyboard input. I have had various problems in doing this due to a bug in the AxWebBrowser receiving input when it is hosting a flash page however I have got it to work using SendKeys for the keyboard input and the Windows API SendInput function for the mouse clicks (along with Cursor.Position) however I'd like to do this in the...
0
9622
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10107
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10048
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4017
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.