STOPFORM(FALSE) //stopボタンを非表示に
//ブラウザをフルスクリーンで起動
Public IE
IE = CreateOLEObj("InternetExplorer.Application")
IE.Visible = true
setOleEvent()
URL = "スライドショーの置いてあるURL"
IE.Navigate(URL)
IE.FullScreen = True
//定期的に読み込み直し
WHILE 1
KBD(VK_F5, CLICK, 100) //F5キーを押す
SLEEP(600) //600秒に1回リロード
GETTIME()
X = G_TIME_HH2 + G_TIME_NN2 //現在時刻の取得
IFB X = 2030 THEN //20時30分にシャットダウンする
POFF(P_SHUTDOWN) //PCをシャットダウン
ENDIF
WEND
//------IE制御用
DEF_DLL SendMessageA(Hwnd, Long, Long, Dword): bool: user32
CONST WM_ACTIVATE = $06
Public Pub_url, Pub_docc, Pub_BeforNav_cnt, Pub_DocComp_cnt, Pub_inp_flg
Procedure BusyWait()
Sleep(0.3)
tm = GetTime()
repeat
ifb GetTime() - tm > 90 // TimeOut
Pub_docc = ""; Pub_BeforNav_cnt=0; Pub_DocComp_cnt=0
IE.Navigate(Pub_url)
tm = GetTime()
endif
Sleep(0.2)
ifb Pub_inp_flg
Pub_inp_flg = False
continue
endif
if IE.busy then continue
if Pub_url = "" then break // No read
if (Pos("*"+Pub_url+"*",Pub_docc)) or (Pos("*"+IE.LocationURL+"*",Pub_docc)) or (Pub_BeforNav_cnt<=Pub_DocComp_cnt) then else continue
errflg = False
if IE.document.title = "503 Unavailable" then errflg = True
if IE.document.title = "Service Unavailable" then errflg = True
if IE.document.title = "503 Service Temporarily Unavailable" then errflg = True
ifb errflg
Sleep(90) // 503: Wait&Retry
tm = 0
continue
endif
Sleep(0.3)
until ! Pub_inp_flg
Pub_url=""; Pub_docc=""; Pub_BeforNav_cnt=0; Pub_DocComp_cnt=0
SendMessageA(IE.Hwnd, WM_ACTIVATE, 0, 0)
Fend
Procedure setOleEvent()
OleEvent(IE, "DWebBrowserEvents2", "BeforeNavigate2", "fucBeforNav")
OleEvent(IE, "DWebBrowserEvents2", "DocumentComplete", "fucDocComp")
OleEvent(IE, "DWebBrowserEvents2", "OnQuit", "fucQuit")
Pub_url=""; Pub_docc=""; Pub_BeforNav_cnt=0; Pub_DocComp_cnt=0; Pub_inp_flg=False
Fend
Procedure fucBeforNav()
ifb (Pos("javascript:",""+EVENT_PRM[1])=0) and ("about:blank"<>""+EVENT_PRM[1])
if Pub_url="" then Pub_url = ""+EVENT_PRM[1]
Pub_BeforNav_cnt = Pub_BeforNav_cnt + 1
endif
Pub_inp_flg = True
Fend
Procedure fucDocComp()
ifb (Pos("javascript:",""+EVENT_PRM[1])=0) and ("about:blank"<>""+EVENT_PRM[1])
Pub_docc = Pub_docc + "*"+EVENT_PRM[1]+"*"
Pub_DocComp_cnt = Pub_DocComp_cnt + 1
endif
Pub_inp_flg = True
Fend
Procedure fucQuit()
ExitExit
Fend