|
#AutoIt3Wrapper_outfile=网络音乐盒.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=播放网络音乐电台
#AutoIt3Wrapper_Res_Fileversion=2.0.1.0
#AutoIt3Wrapper_Res_LegalCopyright=shengda79.com
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$hGui=GUICreate ("")
;加载皮肤
Dim $Dll
FileInstall("SKINCRAFTERDLL.DLL", @TempDir& "\SKINCRAFTERDLL.DLL",1)
FileInstall("VISTA_STYLE.SKF", @TempDir& "\VISTA_STYLE.SKF",1)
$Dll = DllOpen(@TempDir& "\SKINCRAFTERDLL.DLL")
DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", @TempDir& "\VISTA_STYLE.SKF")
DllCall($Dll, "int:cdecl", "DecorateAs", "int", $hGui, "int", 25)
DllCall($Dll, "int:cdecl", "ApplySkin")
Opt("TrayMenuMode",1)
Opt("TrayOnEventMode",1)
Opt("GUIOnEventMode",1)
;加载用标题
Dim $LoadingTitle="正在加载网络播放器,请稍候..."
;频道总数(基于1开始计算),起始频道(基于0开始计算)
Dim $ChannelTotalNo=5,$StartChannelNo=3
;控件,标题,网址,主窗口宽度,主窗口高度,页面控件X坐标,页面控件Y坐标,页面控件宽度,页面控件高度
Dim $song[$ChannelTotalNo][9]= _
[ _
["","SongTaste 用音乐倾听彼此","http://www.songtaste.com/radio.php",356,544,-7,0,390,560], _
["","新浪音乐盒","http://music.sina.com.cn/iframe/yueku/msnshell/msnshellplayer.shtml",308,405,-2,-27,307,500], _
["","百度音乐盒","http://box.zhangmen.baidu.com",525,610,0,0,859,582], _
["","百度电台","http://fm.mp3.baidu.com/",458,265,-125,-155,720,600], _
["","豆瓣电台","http://douban.fm/radio",428,214,0,0,421,186] _
]
;创建托盘开始
TraySetOnEvent(-13,"_mini")
$settingsitem=TrayCreateMenu("切换频道")
For $i=0 To $ChannelTotalNo-1
$song[$i][0]=TrayCreateItem($song[$i][1],$settingsitem)
TrayItemSetOnEvent(-1,"maintray")
Next
TrayItemSetState($song[$StartChannelNo-1][0],1+128)
TrayCreateItem("")
$displayitem=TrayCreateItem("隐藏窗口")
TrayItemSetOnEvent(-1,"maintray")
$aboutitem=TrayCreateItem("关于")
TrayItemSetOnEvent(-1,"maintray")
TrayCreateItem("")
$exititem=TrayCreateItem("退出")
TrayItemSetOnEvent(-1,"maintray")
TraySetClick(16)
;创建托盘结束
;创建GUI开始
$Form = GUICreate("",200,200,-1,-1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "_mini")
$oIE = ObjCreate("Shell.Explorer.2")
$GUIActiveX= GUICtrlCreateObj($oIE,-3000,0)
;创建GUI结束
Dim $stat=1
While 1
If $stat=1 Then
$stat=0
changchannel($StartChannelNo)
;特殊情况
If $song[$StartChannelNo][1]="新浪音乐盒" Then _IEImgClick($oIE, "icon_21.gif","src")
EndIf
Sleep(100)
WEnd
Func maintray()
Switch @TRAY_ID
Case $displayitem
TrayItemSetState($displayitem,4)
_mini()
Case $aboutitem
TrayItemSetState($aboutitem,4)
Msgbox(0,"关于","网络音乐播放器"&@CRLF&"By:春花秋月")
Case $exititem
Exit
EndSwitch
For $i=0 To $ChannelTotalNo-1
If @TRAY_ID=$song[$i][0] Then
$StartChannelNo=$i
$stat=1
EndIf
Next
EndFunc
Func changchannel($ChannelNO=0)
For $i=0 To $ChannelTotalNo-1
If $i=$ChannelNO Then
TrayItemSetState($song[$i][0],1+128)
Else
TrayItemSetState($song[$i][0],4+64)
EndIf
Next
TraySetToolTip($song[$ChannelNO][1])
WinSetTitle($Form,"",$LoadingTitle)
GUICtrlSetPos($GUIActiveX,-3000,$song[$ChannelNO][6],$song[$ChannelNO][7],$song[$ChannelNO][8])
WinMove($Form,"",(@DesktopWidth-$song[$ChannelNO][3])/2,(@DesktopHeight-$song[$ChannelNO][4])/2,$song[$ChannelNO][3],$song[$ChannelNO][4])
open_anim()
WinMove($Form,"",(@DesktopWidth-$song[$ChannelNO][3])/2,(@DesktopHeight-$song[$ChannelNO][4])/2,$song[$ChannelNO][3],$song[$ChannelNO][4])
_IENavigate($oIE,$song[$ChannelNO][2])
GUICtrlSetPos($GUIActiveX,$song[$ChannelNO][5],$song[$ChannelNO][6],$song[$ChannelNO][7],$song[$ChannelNO][8])
WinSetTitle($Form,"",$song[$ChannelNO][1])
EndFunc
Func _mini()
If BitAND(WinGetState($Form),2)=2 Then
TrayItemSetText($displayitem,"显示窗口")
GUISetState(@SW_HIDE,$Form)
Else
TrayItemSetText($displayitem,"隐藏窗口")
GUISetState(@SW_SHOW,$Form)
GUISetState(@SW_RESTORE,$Form)
endif
EndFunc
Func _exit()
;关闭窗口时的特效start
GUICtrlSetPos($GUIActiveX,-3000,0)
For $i=17 To 1 Step -1
WinSetTrans ($Form, "", $i*15 )
$p=WinGetPos($Form)
WinMove($Form, "", $p[0]-1, $p[1]-1, $p[2]+2, $p[3]+2)
Sleep(5)
Next
;关闭窗口时的特效end
Exit
EndFunc
Func open_anim()
;特效start
WinSetTrans ($Form, "",0 )
GUISetState()
$p=WinGetPos($Form)
For $i=1 To 17
WinSetTrans ($Form, "", $i*15 )
If $i<12 Then
WinMove($Form, "", $p[0]-$i, $p[1]-$i, $p[2]+$i*2, $p[3]+$i*2)
$x=WinGetPos($Form)
Else
$k=$i-12
WinMove($Form, "", $x[0]+$k, $x[1]+$k, $x[2]-$k*2, $x[3]-$k*2)
EndIf
Sleep($i)
Next
;特效end
EndFunc
Func Quit()
GUISetState(@SW_HIDE)
DllCall($dll, "int", "DeInitDecoration")
DllCall($dll, "int", "RemoveSkin")
DllClose($dll)
FileDelete ( @TempDir&"\SkinCrafterDll.dll" )
FileDelete ( @TempDir&"\vista_style.skf" )
Exit
EndFunc
这个是经过了加载皮肤的脚本,在退出后又会弹出,如下图:
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|