| |
|
|
| Screen saver V1 - mini Template. CompileMarkSeparation {$cl}
// {$batch copy "screensaver1.exe" "c:winxpscreensaver1.scr"}
/*
WinXP Parameters Information:
Select Saver: /p hdl&
Setup: /c:hdl&
Preview: /s
/p Passes a HWND for the preview
/c Show options dialog
/s Start screen saver
*/
seterrorlevel -1
declare resx&,resy&,ex&,mx&,my&,pipe&,appname$,appver$,hdl&
$U pipe.pcu = pipe.
appname$:="XProfan Screensaver";appver$:="V1.0"
case (val(substr$($winver,1,"."))<5) : _oldos// anti old OS
case pipe.is("xprofan-screensaver") : end// saver is already in use
pipe&:=pipe.create("xprofan-screensaver")// create alreadyInUse blocker
if %parcount>0
if par$(1)=="/p"
hdl&:=val(par$(2))
if (hdl&)
_preview hdl&
endif
elseif par$(1)=="/s"
_main
elseif mid$(par$(1),1,2)=="/c"
_options
else
_main
endif
else
_main
endif
pipe.close pipe&// remove alreadyInUse blocker
end
proc _oldos
messagebox "Sorry, but "+appname$+" "+appver$+" requires WindowsXP or higher.",appname$,16
end
endproc
proc _main
resx&:=%maxx// save resoltion into statics
resy&:=%maxy
windowstyle ( 80 | 512 )// create black window
windowtitle appname$
window 0,0 - 0,0
cls 0
showcursor 0
setwindowpos %hwnd=0,0 - resx&,resy&;-1
settimer 1;waitinput;killtimer// fill %mousexy sysvars and store mousepos into statics
mx&:=%mousex
my&:=%mousey
settimer 500
whilenot ex&
waitinput
ifnot %wmtimer
ex&+
else
case ((%mousex<mx&-5) or (%mousex>mx&+5) or (%mousey<my&-5) or (%mousey>my&+5) ) : ex&+
endif
wend
killtimer
showcursor 1
endproc
proc _preview
parameters h&
endproc
proc _options
messagebox appname$+" "+appver$+" is without any options." me$, 16
endproc
salvo, iF. |
|
|
| |
|
|