;
; Television TV
; Youtube
; Vimeo
; Video
;
; Radio
; Weather 'Current severe weather warnings for the Philippines'
; Picture
; Empty
also some examples here :
http://ahkscript.org/boards/viewtopic.php?f=28&t=1105
Code: Select all
MODIFIED=20150215
Title1=ActiveX_Example
;--------------- ActiveX AutoHotKey --------------------------------------
;- http://ahkscript.org/boards/viewtopic.php?f=6&t=6403 ;- this script
;- http://ahkscript.org/boards/viewtopic.php?f=28&t=1105 ;- other scripts
; Tested with =XP netbook , AHK_L , Firefox , Videolan
;- 2 ActiveX GUI's
;- creates weather.htm and black.htm and picture ( a_scriptdir )
;
;- ActiveX example with :
;
; Television TV
; Youtube
; Vimeo
; Video
;
; Radio
; Weather 'Current severe weather warnings for the Philippines'
; Picture
; Empty
;
; remarks : maybe url changes , then not works
;----------------------------------------------------------------------------
;xxx=Shell.Explorer ;- Microsoft windows browser
xxx=Mozilla.Browser ;- mozilla firefox browser
a:=1
wa:=950
wg:=(wa+20)
ha:=650
hg:=(ha+70)
yb:=(ha+20)
numberofguis:=2
Loop % NumberOfGuis
{
b :=10
Gui %A_Index%: Default
Gui,%A_Index%:Color,Black
gct := A_Index
Gui,%gct%:Add,ActiveX, x10 y3 w%wa% h%ha% vWB%A_Index% ,%xxx%
loop,4
{
Gui,%gct%:Add,Button , x%b% y%yb% h25 w140 v%gct%BT%A_Index% g%gct%Start%a_index%,
b:=(b+150)
}
Gui,%gct%:show,x%a% y3 w%wg% h%hg%,%title1%_%a_index%
a:=(a+wa+27)
wa:=700
wg:=(wa+20)
ha:=(650+70)
hg:=(ha+70)
yb:=(ha+20)
}
GuiControl,1:,1bt1, TV-SWISS
GuiControl,1:,1bt2, YouTube
GuiControl,1:,1bt3, VIMEO
GuiControl,1:,1bt4, VIDEO
GuiControl,2:,2bt1, Radio-Brazil-MPB
GuiControl,2:,2bt2, Weather-Philippines
GuiControl,2:,2bt3, Picture
GuiControl,2:,2bt4, EMPTY
GuiControl,Disable,2Bt4
wb1.silent := true
wb2.silent := true
;-- 1st GUI
;gosub,1start1
;gosub,1start2
;gosub,1start3
;gosub,1start4
;-- 2nd GUI
;gosub,2start1
gosub,2start2
gosub,2start3
;gosub,2start4
return
;-------------
Guiclose:
fx=%a_scriptdir%\weather.htm
ifexist,%fx%
filedelete,%fx%
exitapp
;2Guiclose:
;gui,2:destroy
;return
;-----------------------------
1start1:
f2:="http://www.srf.ch/livestream/player/srf-info"
WB1.Navigate(F2)
gosub,weather
WB2.Navigate(F1)
return
1start2:
id=nKKBmnIfQxg ; portugal
;F2=https://www.youtube.com/v/%id%&index=1&list=RDnKKBmnIfQxg&autoplay=1 ; portugal
F2=https://www.youtube.com/v/%id%&autoplay=1
WB1.Navigate(F2)
gosub,weather
WB2.Navigate(F1)
return
1start3:
F2=https://player.vimeo.com/video/102051605#at=2 ;- Korea North
WB1.Navigate(F2)
gosub,weather
WB2.Navigate(F1)
return
1start4:
F1=C:\test.mp4
ifnotexist,%f1%
return
F2:= "file:///" RegExReplace(F1,"\\","/")
WB1.Navigate(F2)
gosub,weather
WB2.Navigate(F1)
return
;-------------------------
2start1:
f2:="http://www.collectors.com.br/radio/AS3/index.html"
;f2:="about:blank"
WB2.Navigate(F2)
gosub,black
WB1.Navigate(F1)
return
2start2:
gosub,weather
WB2.Navigate(F1)
return
2start3:
F0=http://i.imgur.com/pgCT683.jpg
F1=%a_scriptdir%\China_Canada_Joke.jpg
ifnotexist,%f1%
urldownloadtofile,%f0%,%f1%
F2:= "file:///" RegExReplace(F1,"\\","/")
WB1.Navigate(F2)
return
2start4:
return
;---------------------------
Black:
wa:=(950-20)
ha:=(650-20)
fx=%a_scriptdir%\black.htm
ifnotexist,%fx%
{
e5x=
(Ltrim Join`r`n
<div style="margin:0px;padding:0px;width:%wa%px;height:%ha%px;border:1px solid black;background-color: #000000;">
</div>
)
fileappend,%e5x%`r`n,%fx%
}
stringreplace,fx,fx,\,/,all
F1:="file:///" . fx
return
;-----------------------------
Weather:
wa:=(wa-20)
ha:=(ha-20)
;-http://weather.com.ph/swc
fx=%a_scriptdir%\weather.htm
;ifexist,%fx% ;- get newest or this is deleted when GUI-close
; filedelete,%fx%
ifnotexist,%fx% ;- create once when GUI starts
{
e5x=
(Ltrim Join`r`n
<!-- Begin weather.com.ph map -->
<div style="margin:0px;padding:0px;width:%wa%px;height:%ha%px;border:1px solid black;background-color: #000000;">
<a href="http://weather.com.ph" alt="Current severe weather warnings for the Philippines" title="Current severe weather warnings for the Philippines">
<img src="http://weather.com.ph/layer/warningmaps/philippines_index.png" style="border:0px;margin:0px;padding:0px;width:680px;height:680px" alt="Current severe weather warnings for the Philippines" />
</a>
</div>
<!-- End weather.com.ph map -->
)
fileappend,%e5x%`r`n,%fx%
}
stringreplace,fx,fx,\,/,all
F1:="file:///" . fx
return
;================== end script ========================================================