You were talking about a short script to keep your customer's real screen saver from popping up. This will keep the regular screen saver at bay and provide a little protection for the computer while you're at lunch. Mostly it was fun to create and gave me a chance to develop some techniques I want to use elsewhere
The way this works is it puts up a blank full screen dialog then runs a stayontop box that also moves around thus preventing the real screensaver. Set "passwordvar" to whatever you want the password to be. "Xspeed" and "Yspeed" determine how fast the box will move. "ChangeRate" determines how often the speeds will change. After you start this script, don't worry about catching up with the box using the mouse, just type in your password and press return,(As-is there is no password so simply hit return) that should kill the script. If not, Shift+Esc should kill it. If not..... oops.
You may need to change the path for mshed.exe, depends on your setup.
This is not foolproof and is not meant to represent foolproof screen saving protection. CTRL+ALT+DEL can defeat it for sure as will SHIFT+ESC. Possibly other ways to kill it that I haven't thought of.
It's fun to watch anyway,
Dick
Code: Select all
Let>passwordvar=
Let>XSpeed=10
Let>YSpeed=10
Let>ChangeRate=80
OnEvent>KEY_DOWN,VK9,0,alttab
Dialog>Dialog1
Caption=BackGround
Width=2000
Height=2000
Top=0
Left=0
EndDialog>Dialog1
Let>3wide=133
Let>3high=80
Dialog>Dialog3
Caption=Enter your password
Width=%3wide%
Height=%3high%
Top=120
Left=69
Close=0
Edit=msEdit1,0,0,121,
Button=Ok,24,24,75,25,3
Default=Ok
EndDialog>Dialog3
show>dialog1
WIN>2,BackGround
wait>0.01
CloseDialog>Dialog1
wait>0.001
LibFunc>user32,FindWindowA,dhwnd,TForm,BackGround
LibFunc>user32,SetWindowLongA,sres,dhwnd,-16,65536
show>dialog1
set>BackGround
Show>dialog3
Let>macrofile=%TEMP_DIR%~MovePassWinAround~.scp
IfFileExists>%macrofile%
DeleteFile>%macrofile%
EndIf
WriteLn>%macrofile%,wresult,GCP>X,Y
WriteLn>%macrofile%,wresult, Mou>10000,10000
WriteLn>%macrofile%,wresult, GCP>screenX,screenY
WriteLn>%macrofile%,wresult, MOU>%X%,%Y%
WriteLn>%macrofile%,wresult,Let>moveright=1
WriteLn>%macrofile%,wresult,Let>movedown=1
WriteLn>%macrofile%,wresult,Random>%Xspeed%,Xm
WriteLn>%macrofile%,wresult,Random>%Yspeed%,Ym
WriteLn>%macrofile%,wresult,Random>%ChangeRate%,timeout
WriteLn>%macrofile%,wresult,add>Ym,1
WriteLn>%macrofile%,wresult,add>Xm,1
WriteLn>%macrofile%,wresult,add>timeout,1
WriteLn>%macrofile%,wresult,Let>k=0
WriteLn>%macrofile%,wresult,Label>start
WriteLn>%macrofile%,wresult,Wait>0.01
WriteLn>%macrofile%,wresult,Set>Enter your password
WriteLn>%macrofile%,wresult,GetActiveWindow>window_title,X,Y
WriteLn>%macrofile%,wresult,If>{(%X%<%screenX%-%3wide%)and(%moveright%=1)}
WriteLn>%macrofile%,wresult, Add>X,%Xm%
WriteLn>%macrofile%,wresult,Else>
WriteLn>%macrofile%,wresult, Let>moveright=0
WriteLn>%macrofile%,wresult, If>{(%X%>0)and(%moveright%=0)}
WriteLn>%macrofile%,wresult, Sub>X,%Xm%
WriteLn>%macrofile%,wresult, Else>
WriteLn>%macrofile%,wresult, Let>moveright=1
WriteLn>%macrofile%,wresult, Add>X,%Xm%
WriteLn>%macrofile%,wresult, EndIf
WriteLn>%macrofile%,wresult,EndIf
WriteLn>%macrofile%,wresult,If>{(%Y%<%screenY%-%3high%)and(%movedown%=1)}
WriteLn>%macrofile%,wresult, Add>Y,%Ym%
WriteLn>%macrofile%,wresult,Else>
WriteLn>%macrofile%,wresult, Let>movedown=0
WriteLn>%macrofile%,wresult, If>{(%Y%>0)and(%movedown%=0)}
WriteLn>%macrofile%,wresult, Sub>Y,%Ym%
WriteLn>%macrofile%,wresult, Else>
WriteLn>%macrofile%,wresult, Let>movedown=1
WriteLn>%macrofile%,wresult, Add>Y,%Ym%
WriteLn>%macrofile%,wresult, EndIf
WriteLn>%macrofile%,wresult,EndIf
WriteLn>%macrofile%,wresult,MoveWindow>%window_title%,%X%,%Y%
WriteLn>%macrofile%,wresult,If>{(%k%>%timeout%)}
WriteLn>%macrofile%,wresult, Let>k=0
WriteLn>%macrofile%,wresult, Random>%Xspeed%,Xm
WriteLn>%macrofile%,wresult, Random>%Yspeed%,Ym
WriteLn>%macrofile%,wresult, Random>%ChangeRate%,timeout
WriteLn>%macrofile%,wresult, add>timeout,1
WriteLn>%macrofile%,wresult, add>Ym,1
WriteLn>%macrofile%,wresult, add>Xm,1
WriteLn>%macrofile%,wresult,Else
WriteLn>%macrofile%,wresult, add>k,1
WriteLn>%macrofile%,wresult,EndIf
WriteLn>%macrofile%,wresult,IfW>Enter your password,start,end
WriteLn>%macrofile%,wresult,Label>end
Run>C:\Program Files\MJT Net Ltd\Macro Scheduler\msched.exe %macrofile%
Label>start
Set>Enter your password
GDA>dialog3,r3
If>r3=3,process
Wait>0.01
Release ALT
Release LALT
Release RALT
Release ALTGR
Release CTRL
Release LCTRL
Release RCTRL
Release LWinKey
Release RWinKey
goto>start
SRT>process
If>%dialog3.msedit1%=%passwordvar%,end
Press tab
Let>%dialog3.msedit1%=
RDA>dialog3
Press tab
END>process
SRT>alttab
set>BackGround
Set>Enter your password
END>alttab
Label>end