473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Blocking Screensaver from Appearing

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.
Aug 1 '05 #1
4 5043
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.

Aug 2 '05 #2
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.

Aug 3 '05 #3
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.

Aug 3 '05 #4
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.

Aug 3 '05 #5

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

Similar topics

1
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...
4
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...
0
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. ...
2
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...
0
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...
1
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...
4
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...
4
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...
6
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.