| View previous topic :: View next topic |
| Author |
Message |
briguy Contributor

Joined: 09 Aug 2007 Posts: 79
|
Posted: Wed Nov 04, 2009 7:59 pm Post subject: Mouse Move |
|
|
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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Nov 04, 2009 9:24 pm Post subject: |
|
|
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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Nov 04, 2009 9:31 pm Post subject: |
|
|
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 |
|
 |
briguy Contributor

Joined: 09 Aug 2007 Posts: 79
|
Posted: Thu Nov 05, 2009 1:53 pm Post subject: |
|
|
| 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 |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Nov 05, 2009 2:00 pm Post subject: |
|
|
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 |
|
 |
briguy Contributor

Joined: 09 Aug 2007 Posts: 79
|
Posted: Thu Nov 05, 2009 7:55 pm Post subject: |
|
|
SnarlingSheep,
Works like a champ..
Thanks!! |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Nov 05, 2009 7:59 pm Post subject: Re: Mouse Move |
|
|
If SnarlingSheeps suggestion does not work for you. Robotic Arm 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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Thu Nov 05, 2009 8:46 pm Post subject: |
|
|
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 |
|
 |
briguy Contributor

Joined: 09 Aug 2007 Posts: 79
|
Posted: Thu Nov 05, 2009 9:09 pm Post subject: |
|
|
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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri Nov 06, 2009 1:47 am Post subject: |
|
|
Ah, Ok, I understand now. You can't even touch the saver settings due to lack of privileges.  _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|
|
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
|
|