代码很简单。
请将附件压缩包里的ini文件和脚本放在一个目录里运行。
#include <IE.au3>
Opt("TrayMenuMode", 1)
Opt("GUIOnEventMode", 1)
Dim $MenuItem[100]
$meun = -1
$aData1 = IniReadSection("favorate.ini", "web")
For $i = 1 To UBound($aData1) - 1
$MenuItem[$i] = TrayCreateItem($aData1[$i][0], $meun)
If $aData1[$i][1] = 1 Then
TrayItemDelete($MenuItem[$i])
$meun = TrayCreateMenu($aData1[$i][0])
EndIf
Next
TrayCreateItem("")
$MenuItem0 = TrayCreateItem("退出")
While 1
$msg = TrayGetMsg()
For $i = 1 To UBound($aData1) - 1
If $msg = $MenuItem[$i] Then
openweb($aData1[$i][1])
ElseIf $msg = $MenuItem0 Then
Exit
EndIf
Next
WEnd
Func openweb($www)
$oIE = _IECreate($www, 0, 1, 0)
$hwnd = _IEPropertyGet($oIE, "hwnd")
WinSetState($hwnd, "", @SW_MAXIMIZE)
EndFunc ;==>openweb
|