I have been given an unusual task to create a Windows Service to do something
periodically to make the screensaver timer reset. We have a general policy
of locking computers automatically after 10 minutes of inactivity. This
windows service would be used on some machines to prevent the lock from
occurring every 10 minutes.
I have tried to reposition the mouse pointer with the Cursor class in a
service, but it does not work -- always sees the cursor at 0,0 and does not
recognize a new position being set for it. I have also looked for something
to directly reset the timer the screensaver uses, but have found nothing.
If someone could suggest a straightforward way to capture the real mouse
coordinates from a .NET Windows Service, so I can nudge the mouse to prevent
the screensaver from appearing, or to directly reset the screensaver timer,
that would be most helpful. We can not just set Windows properties (like
screensaver to none), as we do not want users to be able to prevent the
screensaver from appearing. 4 5058
Paul,
I went through the same exercise a while back. Unfortunately,
programmatically moving the mouse won't do it. If you use a Group Policy to
set the screensaver I can tell you it's a semi-futile effort to try to
override that to any extent. My spec was to set the timeout, active flag,
start time, end time, etc.
I ended up writing a .net service that checks a registry setting on a
periodic basis. If the setting was 1 the set it to 0. The registry key is
HKEY_Users\Software\Policies\Microsoft\Windows\Con trol
Panel\Desktop\ScreenSaveActive. Also note that if you are using a service
under the local system context, you'll need to iterate through all the logged
on users in the HKEY_USERS hive and set the \ScreenSaveActive bit
appropriately.
If you're not using group policy for the screen saver there are api calls
you can make that are fairly simple.
-Mike
"Paul Smith" wrote: I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10 minutes of inactivity. This windows service would be used on some machines to prevent the lock from occurring every 10 minutes.
I have tried to reposition the mouse pointer with the Cursor class in a service, but it does not work -- always sees the cursor at 0,0 and does not recognize a new position being set for it. I have also looked for something to directly reset the timer the screensaver uses, but have found nothing.
If someone could suggest a straightforward way to capture the real mouse coordinates from a .NET Windows Service, so I can nudge the mouse to prevent the screensaver from appearing, or to directly reset the screensaver timer, that would be most helpful. We can not just set Windows properties (like screensaver to none), as we do not want users to be able to prevent the screensaver from appearing.
Mike,
Thank you. We are using a group policy, so I will approach it as resetting
these registry keys.
"Mike S." wrote: Paul, I went through the same exercise a while back. Unfortunately, programmatically moving the mouse won't do it. If you use a Group Policy to set the screensaver I can tell you it's a semi-futile effort to try to override that to any extent. My spec was to set the timeout, active flag, start time, end time, etc.
I ended up writing a .net service that checks a registry setting on a periodic basis. If the setting was 1 the set it to 0. The registry key is HKEY_Users\Software\Policies\Microsoft\Windows\Con trol Panel\Desktop\ScreenSaveActive. Also note that if you are using a service under the local system context, you'll need to iterate through all the logged on users in the HKEY_USERS hive and set the \ScreenSaveActive bit appropriately.
If you're not using group policy for the screen saver there are api calls you can make that are fairly simple.
-Mike
"Paul Smith" wrote:
I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10 minutes of inactivity. This windows service would be used on some machines to prevent the lock from occurring every 10 minutes.
I have tried to reposition the mouse pointer with the Cursor class in a service, but it does not work -- always sees the cursor at 0,0 and does not recognize a new position being set for it. I have also looked for something to directly reset the timer the screensaver uses, but have found nothing.
If someone could suggest a straightforward way to capture the real mouse coordinates from a .NET Windows Service, so I can nudge the mouse to prevent the screensaver from appearing, or to directly reset the screensaver timer, that would be most helpful. We can not just set Windows properties (like screensaver to none), as we do not want users to be able to prevent the screensaver from appearing.
Mike,
The registry approach works like a charm. Thanks again.
"Mike S." wrote: Paul, I went through the same exercise a while back. Unfortunately, programmatically moving the mouse won't do it. If you use a Group Policy to set the screensaver I can tell you it's a semi-futile effort to try to override that to any extent. My spec was to set the timeout, active flag, start time, end time, etc.
I ended up writing a .net service that checks a registry setting on a periodic basis. If the setting was 1 the set it to 0. The registry key is HKEY_Users\Software\Policies\Microsoft\Windows\Con trol Panel\Desktop\ScreenSaveActive. Also note that if you are using a service under the local system context, you'll need to iterate through all the logged on users in the HKEY_USERS hive and set the \ScreenSaveActive bit appropriately.
If you're not using group policy for the screen saver there are api calls you can make that are fairly simple.
-Mike
"Paul Smith" wrote:
I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10 minutes of inactivity. This windows service would be used on some machines to prevent the lock from occurring every 10 minutes.
I have tried to reposition the mouse pointer with the Cursor class in a service, but it does not work -- always sees the cursor at 0,0 and does not recognize a new position being set for it. I have also looked for something to directly reset the timer the screensaver uses, but have found nothing.
If someone could suggest a straightforward way to capture the real mouse coordinates from a .NET Windows Service, so I can nudge the mouse to prevent the screensaver from appearing, or to directly reset the screensaver timer, that would be most helpful. We can not just set Windows properties (like screensaver to none), as we do not want users to be able to prevent the screensaver from appearing.
Good to hear! Glad to be able to help.
"Paul Smith" wrote: Mike,
The registry approach works like a charm. Thanks again.
"Mike S." wrote:
Paul, I went through the same exercise a while back. Unfortunately, programmatically moving the mouse won't do it. If you use a Group Policy to set the screensaver I can tell you it's a semi-futile effort to try to override that to any extent. My spec was to set the timeout, active flag, start time, end time, etc.
I ended up writing a .net service that checks a registry setting on a periodic basis. If the setting was 1 the set it to 0. The registry key is HKEY_Users\Software\Policies\Microsoft\Windows\Con trol Panel\Desktop\ScreenSaveActive. Also note that if you are using a service under the local system context, you'll need to iterate through all the logged on users in the HKEY_USERS hive and set the \ScreenSaveActive bit appropriately.
If you're not using group policy for the screen saver there are api calls you can make that are fairly simple.
-Mike
"Paul Smith" wrote:
I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10 minutes of inactivity. This windows service would be used on some machines to prevent the lock from occurring every 10 minutes.
I have tried to reposition the mouse pointer with the Cursor class in a service, but it does not work -- always sees the cursor at 0,0 and does not recognize a new position being set for it. I have also looked for something to directly reset the timer the screensaver uses, but have found nothing.
If someone could suggest a straightforward way to capture the real mouse coordinates from a .NET Windows Service, so I can nudge the mouse to prevent the screensaver from appearing, or to directly reset the screensaver timer, that would be most helpful. We can not just set Windows properties (like screensaver to none), as we do not want users to be able to prevent the screensaver from appearing. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: klappnase |
last post by:
Hello everyone,
does anyone know a way to stop the screensaver under linux from
starting up while a certain process is running?
I need this because I experience a memory leak while recording...
|
by: Christopher Burr |
last post by:
I'm trying to set the user's screensaver in the .NET world...
In Win32 I could use a combination of setting the screen saver name via the
registry and then setting the time and active status...
|
by: Luke |
last post by:
I am trying to capture an event when the screensaver starts. I have code
working on Windows XP etc when the Password/Welcome Screen is enabled
. Using the Fast User Switching Notifications.
...
|
by: DanielB |
last post by:
Does anyone know what the command line argumentto launch a
screensaver's options/configuration dialog is on Windows XP Pro?
From most of the example source code I can find on the web, it would...
|
by: Paul Smith |
last post by:
I have been given an unusual task to create a Windows Service to do something
periodically to make the screensaver timer reset. We have a general policy
of locking computers automatically after 10...
| |
by: DanielB |
last post by:
Does anyone know what the command line argumentto launch a
screensaver's options/configuration dialog is on Windows XP Pro?
From most of the example source code I can find on the web, it would...
|
by: Simon Mercer |
last post by:
I have been trying to build a screensaver that will connect to a database
and display specific data depending on the user that is logged in. I have
managed to get a simple data access screensaver...
|
by: Paul Smith |
last post by:
I have been given an unusual task to create a Windows Service to do something
periodically to make the screensaver timer reset. We have a general policy
of locking computers automatically after 10...
|
by: VMI |
last post by:
How difficult is it to develop a screensaver in C#? The screensaver would be
composed of several images and each image would be displayed on the screen
for a few seconds. The only difficult part...
|
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,...
|
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...
| |
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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |