#include"hspext.as" #include"llmod.as" ;このプログラムの動作にはhspext.dllかhsp2max.hrtが必要です。 a=cmdline if a="on" : goto *s_on : else : if a="off" : goto *s_off : else : goto *config *main ;Win32APIでWindowへ新しいパラメータを通知 dim prm,4 : prm=17,b,0,1 dllproc"SystemParametersInfoA",prm,5,1 ;レジストリを確認 regkey 0,"Control Panel\\Desktop",0 if stat{ regkey 0,"Control Panel\\Desktop",1 ;一応例外処理 if stat{ dialog"レジストリ確認エラー",1,"Screen Saver Switcher" end } } getreg c,"ScreenSaveActive",1 ;もしレジストリの値が正しくなければ書き込み if a!c{ setreg a,"ScreenSaveActive",1 ;こっちも一応例外処理 if stat{ dialog"レジストリ書き込みエラー",1,"Screen Saver Switcher" } } *en end *config ;メインウィンドウ ginfo 0 : x=prmx-65 : y=prmy-25 screen 0,130,50,2,x,y : title"S.S.S." objsize 50,40 : font"",15 : objmode 2,1 pos 10,5 : button "ON",*s_on : pos 70,5 : button "OFF",*s_off gsel 0,1 : stop *s_on a="1" : b=1 : goto *main *s_off a="0" : b=0 : goto *main