forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Mouse Move

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Wed Nov 04, 2009 7:59 pm    Post subject: Mouse Move Reply with quote

Is there a way to move the mouse so that it will simulate an actual movement of the mouse so the screen saver will not kick in.

The below code moves the mouse but the screen saver kicks in anyway.

Code:


:myloop
wait 59
LOADLIB USER32.DLL

    %X = 20
    %Y = 30
    %j = @LIB(user32,SetCursorPos,,INT:%X,INT:%Y)
      FREELIB USER32.DLL
goto myloop

Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Nov 04, 2009 9:24 pm    Post subject: Reply with quote

Couldn't you just use the screensaver dll from PK? it allows you to disable or enable the saver. You could simply disable the saver while your program is working, then when done re-enable the saver.
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Nov 04, 2009 9:31 pm    Post subject: Reply with quote

It's on page 12 of the freeware extensions, vdssave.dll

As well, Codescript seems to have done a DSU for managing the screensaver and may also have the ability to enable and disable the saver.

It's on page 2 of source codes "Control Screen Saver and Monitor DSU"

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Thu Nov 05, 2009 1:53 pm    Post subject: Reply with quote

No I don't believe that will work. I work on a network with very strict GPO policies but unfortunately those GPO cannot be blocked they are enforced. Then there is a need to have a few machines that have the screen not go into screen saver mode "network monitor stations" So I'm in a quandary
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Nov 05, 2009 2:00 pm    Post subject: Reply with quote

Try mouse_event:
Code:
%%MOUSEEVENTF_MOVE = $01
loadlib user32.dll
random @datetime(hhnnss)
:Timer
  REM Random amounts to move mouse each way
  %%MOUSEY = @random(-500,500)
  %%MOUSEX = @random(-500,500)
  %p = @lib(user32,mouse_event,NIL:,INT:%%MOUSEEVENTF_MOVE,INT:%%MOUSEX,INT:%%MOUSEY,INT:0,INT:0)
:evloop
  wait event,10
  goto @event()

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Thu Nov 05, 2009 7:55 pm    Post subject: Reply with quote

SnarlingSheep,

Works like a champ..

Thanks!!
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Nov 05, 2009 7:59 pm    Post subject: Re: Mouse Move Reply with quote

If SnarlingSheeps suggestion does not work for you. Idea Robotic Arm Laughing I think you could get the kit from Radio Shack here in the US. Another thought would be to either extend the timeout for the screensaver or just turnoff the screensaver. I think there is a programatic way to turn on and off the screensaver. I don't think I would want my mouse to all of a sudden start moving on me.
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Nov 05, 2009 8:46 pm    Post subject: Reply with quote

So you're not allowed to use a dll but you're allowed to use an exe? I'm not sure I understand what you mean, but it sounds like the vdssave.dll or the dsu might be exactly what you need. Disable the screen saver would save you from having to move the mouse at all.
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Thu Nov 05, 2009 9:09 pm    Post subject: Reply with quote

I totally see both of your points. Here is what I did and the reason behind it. The reason is the user does not have elivated rights to his box. So he will not be able to extend or change the timeout. The user has a application that is displayed on a BIG SCREEN for there job. The GPO pushes down the screen saver policy from the root of active directory to all boxes. It is enforced. After 15 minutes if there not moving the mouse on the BIG SCREEN it locks and they have to login again or in some cases wait till user 2 comes back from a break or they hard boot the box.


Code:


Title Mouse_it
  DIALOG CREATE,S-A,-1,0,150,48,ONTOP,CLASS S-A,SMALLCAP
  DIALOG ADD,STYLE,STYLE1,Arial,8,,,WHITE
  DIALOG ADD,SHAPE,SHAPE1,0,0,150,48,0080FF,GRAY,,RECTANGLE
  DIALOG ADD,TEXT,TEXT1,5,12,,,Screen Alive - DISABLED,,STYLE1
  DIALOG ADD,TEXT,TEXT2,23,9,,,Ctrl+Shift+F8 to DISABLE,,STYLE2
  DIALOG ADD,BUTTON,BUTTON1,19,6,136,24,Enable
  DIALOG HIDE,TEXT2
  DIALOG SHOW
 
hotkey ADD,8,Ctrl+Shift+F8
 
:Evloop
  wait event
  goto @event()

:Button1button
DIALOG HIDE,BUTTON1
DIALOG SETPOS,TEXT1,6,16,,
DIALOG SET,TEXT1,Screen Alive - ENABLED
DIALOG SHOW,TEXT2

#-----------------make window transparent ------------------------
   loadlib USER32
      %%hh = @strdel(@WINEXISTS(#S-A),1,1)
      if %%HH
         %i = @lib(user32,GetWindowLongA,INT:,%%HH,-20)
         %i = @lib(user32,SetWindowLongA,INT:,%%HH,-20,$80000)
         %i = @lib(user32,SetLayeredWindowAttributes,INT:,%%HH,0,100,$2)
         %i = @lib(user32,SetWindowLongA,INT:,%%HH,-20,-4000)
      else
         error -1
      end
      freelib USER32
   end
#-----------------make window transparent ------------------------

%%MOUSEEVENTF_MOVE = $01
loadlib user32.dll
random @datetime(hhnnss)
:Timer

#  %%MOUSEY = @random(-500,500)
#  %%MOUSEX = @random(-500,500)

%%MOUSEY = 1
%%MOUSEX = 1

  %p = @lib(user32,mouse_event,NIL:,INT:%%MOUSEEVENTF_MOVE,INT:%%MOUSEX,INT:%%MOUSEY,INT:0,INT:0)
#:evloop
  wait event,600
  goto @event()

goto evloop


:Hotkey

%%hk = @hotkey()
if @equal(%%hk,8)
   # WINDOW NORMAL,#TBLE
#   %%dynapos = 0
   loadlib USER32
   %%HG = @strdel(@WINEXISTS(#S-A),1,1)
   if %%HG
      %i = @lib(user32,GetWindowLongA,INT:,%%HG,-20)
      %i = @lib(user32,SetLayeredWindowAttributes,INT:,%%HG,0,255,$2)
      %i = @lib(user32,SetWindowLongA,INT:,%%HG,-20,$100)
   else
      error -1
   end
   freelib USER32
end
end
DIALOG SETPOS,SHAPE1,-1,0,153,48
DIALOG SETPOS,TEXT1,5,12,
DIALOG SETPOS,BUTTON1,19,6,
DIALOG SET,TEXT1,Screen Alive - DISABLED
DIALOG HIDE,TEXT2
DIALOG SHOW,BUTTON1

goto evloop

:Close
  exit
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri Nov 06, 2009 1:47 am    Post subject: Reply with quote

Ah, Ok, I understand now. You can't even touch the saver settings due to lack of privileges. Sad
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group