Results 1 to 20 of 20

Thread: Stop screensaver coming on..move mouse?

  1. #1

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Stop screensaver coming on..move mouse?

    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

  2. #2
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: Stop screensaver coming on..move mouse?

    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?

  3. #3

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Stop screensaver coming on..move mouse?

    When you work in a large company they lockdown parts of the PC...even a developers.... this is to stop the screensaver triggering

  4. #4
    Fanatic Member bgmacaw's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, GA USA
    Posts
    524

    Re: Stop screensaver coming on..move mouse?

    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.

  5. #5

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Stop screensaver coming on..move mouse?

    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

  6. #6
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Stop screensaver coming on..move mouse?

    Are you just looking to disable the screensaver while your application is running?

  7. #7

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Stop screensaver coming on..move mouse?

    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

  8. #8
    Fanatic Member bgmacaw's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, GA USA
    Posts
    524

    Re: Stop screensaver coming on..move mouse?

    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

  9. #9
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Stop screensaver coming on..move mouse?

    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?

  10. #10

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Stop screensaver coming on..move mouse?

    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...

  11. #11
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Stop screensaver coming on..move mouse?

    Quote Originally Posted by Ggalla1779
    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?

    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?

  12. #12

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Stop screensaver coming on..move mouse?

    1 what though?? Havent done this before is a tick 0.01? so
    Button1.Location.X + 0.01??

  13. #13
    Fanatic Member bgmacaw's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, GA USA
    Posts
    524

    Re: Stop screensaver coming on..move mouse?

    Well, if all else fails you could try this idea from a Simpsons episode: http://en.wikipedia.org/wiki/King-Size_Homer

    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.

  14. #14

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Stop screensaver coming on..move mouse?

    so what do i have to add to y position for 100 pixel

  15. #15
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Stop screensaver coming on..move mouse?

    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.
    Last edited by nbrege; Jun 21st, 2007 at 10:02 AM.

  16. #16

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Stop screensaver coming on..move mouse?

    thanks will test that out

  17. #17
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: Stop screensaver coming on..move mouse?

    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.

    When you work in a large company
    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.

    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.
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  18. #18
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Stop screensaver coming on..move mouse?

    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.

    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
    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.
    Last edited by milkmood; Aug 14th, 2007 at 04:10 PM.
    When I say 'jump', don't waste time asking 'how high?'.

    Just a poor, dumb wanna-be programmer.

  19. #19
    Junior Member
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Posts
    27

    Re: Stop screensaver coming on..move mouse?

    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

  20. #20
    Lively Member milkmood's Avatar
    Join Date
    Mar 2005
    Location
    Forests of Delta Halo
    Posts
    109

    Re: Stop screensaver coming on..move mouse?

    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.
    When I say 'jump', don't waste time asking 'how high?'.

    Just a poor, dumb wanna-be programmer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width