Hi
Am trying to stop a screensaver coming on my PC, is it possible to move the mouse pointer just a touch every so often?
If it cant bee seen by naked eye that would be good as well.....
cheers George
Printable View
Hi
Am trying to stop a screensaver coming on my PC, is it possible to move the mouse pointer just a touch every so often?
If it cant bee seen by naked eye that would be good as well.....
cheers George
Any physical action will reset the screen saver's timer... even sending it a keystroke. And yes it is possible to do in VB (although I'm not qualified to teach)... but why not just turn the screen saver off?
When you work in a large company they lockdown parts of the PC...even a developers.... this is to stop the screensaver triggering
Why don't you talk to your boss about giving you local admin rights on your PC? It will be more difficult for you to develop in .NET if you don't have this level of access. Make sure you put such a request in terms of productivity costs for you and the net admin staff and often you'll see positive results.
If this doesn't work, be a pain in the rear to the net admin staff until they get tired of supporting you. :D
I already develop in .net this is just a pain for the screensaver to come on.... isnt there an easy way to shift the mouse a fraction every 50seconds?
I found this on a web search
Windows.Forms.Cursor.Position = New System.Drawing.Point(Button1.Location.X + (Button1.Width / 2), Button1.Location.Y + (Button1.Height / 2))
but it jumps the mouse quite a bit...am looking for subtle movement...if any
Are you just looking to disable the screensaver while your application is running?
no..I am looking to move the mouse cursor a fraction on a timed event...say every 50seconds move the mouse cursor slightly. that way the Screensaver wont trigger
Have you tried the SystemParametersInfo API? I'm not sure how well it works in locked down XP or Vista (my code for it is from either VB3 or 4).
Here's some C# code for this I turned up in a Google search: http://www.codeproject.com/csharp/Sc...verControl.asp
I'm not sure how to simulate moving the mouse in code, but I have stopped the screensaver by terminating the process in code. Will that work for you, or are you locked out from terminating processes?
never tried it....can give it a go if you think it would work.
Whats up with a wee program that sits and moves the mouse every 50 seconds when I am not there, to stop the creensaver firing?
When I say simulate...it just needs to move the mouse cursor a bit...
Quote:
Originally Posted by Ggalla1779
I guess nothing, if it works. If the code you posted above works, then you should be able to modify it to move the mouse only a little. It looks like its using a Button width & height to move the mouse. Can't you get the current cursor location & just increment it by 1 at each timer tick?
1 what though?? Havent done this before is a tick 0.01? so
Button1.Location.X + 0.01??
Well, if all else fails you could try this idea from a Simpsons episode: http://en.wikipedia.org/wiki/King-Size_Homer :D
On the mouse movement thing, just check every few seconds to see if the mouse is near the same position that it was on the previous check. If it is, then move it a few 100 pixels, wait a few ticks, then move it back. You could also add in a keyboard activity check as well.
so what do i have to add to y position for 100 pixel
I just tried this code & it moves the cursor 1 pixel at a time every second:
Code:Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position.X + 1, Windows.Forms.Cursor.Position.Y + 1)
End Sub
You might have to move the cursor more than 1 pixel to interupt the screensaver ... I'm not sure what it's sensitivity is.
thanks will test that out
nbrege's idea will most likely work.
However, the reason employer's like screensavers coming on every so often (and I'm guessing making you reenter your password) is for security. If you walk off, your computer is automatically locked up. So, some passerby is less likely to get info they aren't intended to see. This also protects you.
You might want to be careful. If someone finds out about this, you could possibly get fired. This is sort of like them making the effort to have the door automatically lock, and you sticking a wedge under it because you don't like pulling the key out of your pocket each time you want back in.Quote:
When you work in a large company
However, this is entirely possible to do. And if you are going to go through with it, make sure to set ShowInTaskBar to False.
Good luck.
No need for APIs, here's what I did. It just moves the cursor in a diagonal direction in steps, then pops it back to the origin after x steps. I keep a small form visible so I can kill it if need be, but you can hide it just as easily. Below is the entire code for the tweak. I carry no responsibility if you get in trouble for using this, I am my company's sole IT Manager, so I can do what I need to do.
I use this occasionally during times when I have a loooooong backup running in an RDP session on a machine under a DDP I'd rather not modify. In RDP, keep the mouse over the RDP window.
Oh, and I set my time interval at 10000, but any of the above numbers can be tweaked to move the mouse more or less frequently.Code:Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static tickcount As Integer = 0
Static Origin As Point = New Point(400, 400)
If Origin.X = +20 Then
tickcount = 0
Origin = Cursor.Position
End If
tickcount += 10
Windows.Forms.Cursor.Position = New System.Drawing.Point(Origin.X + (tickcount Mod 100), Origin.Y + (tickcount Mod 100))
End Sub
End Class
there is an easier way with windows xp that requires no code just right click on your desktop>properties>screen saver tab>Power...>then set turn off monitor: never or every couple hours whatever you want, its good for powerpoint presentations and watching tv shows or movies
The point of this is for those who can't change their screen saver settings in a domain environment because it is controlled by the default domain policy or some group policy object.