ActiveX 2-GUI Пример

Опубликуйте ваши работающие скрипты, библиотеки и ПО для AutoHotkey
garry
Posts: 1569
Joined: 22 Dec 2013, 12:50

ActiveX 2-GUI Пример

14 Feb 2015, 09:24

;- ActiveX example plays:
; Television TV
; Youtube
; Vimeo
; Radio
; Weather 'Current severe weather warnings for the Philippines'
; Picture
;

Code: Select all

MODIFIED=20150214/2
Title1=ActiveX_Example
;----------------------------------------------------------------------
;-  http://ahkscript.org/boards/viewtopic.php?f=6&t=6403   ;- this
;-  http://ahkscript.org/boards/viewtopic.php?f=28&t=1105

;   XP netbook AHK_L
;-  2 ActiveX GUI's
;-  creates templates weather.htm  and black.htm  ( a_scriptdir )
;-  downloads a test picture to desktop
;
;-  ActiveX example plays:
;     Television TV
;     Youtube
;     Vimeo
;     Radio
;     Weather 'Current severe weather warnings for the Philippines'
;     Picture
;
;     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,3
         {
         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+28)
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,2:,2bt1, Radio-Brazil-MPB
GuiControl,2:,2bt2, Weather-Philippines
GuiControl,2:,2bt3, Picture
;GuiControl,Disable,2Bt3

;-- 1st GUI
;gosub,1start1
;gosub,1start2
;gosub,1start3
;-- 2nd GUI
;gosub,2start1
gosub,2start2
gosub,2start3
return
;-------------

Guiclose:
fx=%a_scriptdir%\weather.htm
ifexist,%fx%
  filedelete,%fx%
exitapp

;-----------------------------
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
;-------------------------

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_desktop%\China_Canada_Joke.jpg
ifnotexist,%f1%
   urldownloadtofile,%f0%,%f1%
F2:= "file:///" RegExReplace(F1,"\\","/")
WB1.Navigate(F2)
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 ========================================================

Return to “Скрипты и библиотеки”

Who is online

Users browsing this forum: Google [Bot] and 0 guests