#include <GUIConstants.au3>
#include <string.au3>
#include <IE.au3>
#Include <process.au3>
#NoTrayIcon
dim $Combo1
HotKeySet("{F5}", "CL")
HotKeySet("{F6}", "yc")
$fw = 115
$fh = 50
$width = 85
$height = 17
$x = 20
$y = 15
$temp = 0
$xplus = $width + 10
$yplus = $height + 15
$l = 10
$listdq = IniReadSection(@ScriptDir & "\连接管理.ini" , "设置" )
$m = UBound($listdq,1)-2
$n = UBound($listdq,2)
Dim $dqbqd[$m]
Dim $tmpArray[$m][$n]
For $a = 2 To UBound($listdq,1)-1
For $b = 0 To UBound($listdq,2)-1
$tmpArray[$a-2][$b] = $listdq[$a][$b]
ConsoleWrite($tmpArray[$a-2][$b] & @CRLF)
Next
Next
$fw = $fw + 95 * int($m/10+0.9)-95
if int($m/10+0.9) < 2 then $fw =115
$fh = $fh + 32 * $m-32
if $m > 10 then $fh =340
if $m < 2 then $fh =53
$Form1 = GUICreate("快捷工具", $fw, $fh )
GUISetBkColor (0x396DA5)
For $i = 0 To $listdq[0][0]-2
If $temp < Int($i/$l) Then
$x = $x + $xplus
$temp = Int($i/$l)
EndIf
$listel1 = _StringEncrypt ( 0, $tmpArray[$i][0] , "lansemengxiangjiamixitong","administrators" )
$dqbqd[$i] = GUICtrlCreateButton( $listel1, $x,$y+$yplus*Mod($i,$l), 75, 25)
Next
GUISetState(@SW_SHOW)
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_EVENT_SECONDARYUP
listgl()
Case $msg = $GUI_EVENT_MINIMIZE
yc()
Case Else
FOR $K =0 TO $listdq[0][0]-2
IF $msg = $dqbqd[$k] then
$listel2 = _StringEncrypt ( 0, $tmpArray[$k][1] , "lansemengxiangjiamixitong","administrators" )
if StringInStr($listel2,"http://") = true then
_IECreate ($listel2, 1, 1, 0)
$bt = WinGetTitle ( "" )
WinSetState ( $bt , "" , @SW_MAXIMIZE )
ElseIf StringInStr($listel2,"ftp://") = true then
_IECreate ($listel2, 1, 1, 0)
$bt = WinGetTitle ( "" )
WinSetState ( $bt , "" , @SW_MAXIMIZE )
ElseIf StringInStr($listel2,"www.") = true then
_IECreate ($listel2, 1, 1, 0)
$bt = WinGetTitle ( "" )
WinSetState ( $bt , "" , @SW_MAXIMIZE )
Else
_RunDOS( "start " & $listel2 )
EndIf
EndIf
Next
EndSelect
WEnd
Func listgl()
GUISetState(@SW_HIDE,$Form1)
$ComboList = ""
$ljqgz = GUICreate("连接器管理", 231, 134 )
$listz = IniReadSection(@ScriptDir & "\连接管理.ini" , "设置" )
$Combo1 = GUICtrlCreateCombo("", 44, 8, 177, 21 , BitOR($CBS_DROPDOWNLIST,$CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_VSCROLL))
For $i = 1 To $listz[0][0]
$list = _StringEncrypt ( 0, $listz[$i][0] , "lansemengxiangjiamixitong","administrators" )
$ComboList=$ComboList&"|"&$List
Next
GuiCtrlSetData($Combo1,$ComboList,"------连 接 器 列 表------")
$Input1 = GUICtrlCreateInput("", 44, 40, 177, 21)
$Input2 = GUICtrlCreateInput("", 44, 72, 177, 21)
GUICtrlCreateLabel("列 表:", 8, 12, 36, 17)
GUICtrlCreateLabel("名 称:", 8, 43, 36, 17)
GUICtrlCreateLabel("执 行:", 8, 75, 36, 17)
$tjlb = GUICtrlCreateButton("添 加", 8, 104, 67, 25, $BS_DEFPUSHBUTTON)
$sclb = GUICtrlCreateButton("删 除", 80, 104, 67, 25, 0)
$tclb = GUICtrlCreateButton("退 出", 152, 104, 67, 25, 0)
GUISetState(@SW_SHOW)
While 2
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE or $msg = $tclb
GUISetState(@SW_HIDE,$ljqgz)
run ( @ScriptDir & "\快捷工具.exe /08060225")
exit
Case $msg = $tjlb
$sj1 = GUICtrlRead($Input1)
$sj2 = GUICtrlRead($Input2)
if $sj1 = "" then
msgbox(48,"错误","名称不能空!")
ElseIf $sj2 = "" then
msgbox(48,"错误","执行不能空!")
Else
IniWrite ( @ScriptDir & "\连接管理.ini", "设置", _StringEncrypt ( 1, $sj1 , "lansemengxiangjiamixitong","administrators" ) , _StringEncrypt ( 1, $sj2 , "lansemengxiangjiamixitong","administrators" ) )
msgbox(48,"提示","添加成功!")
GUICtrlSetData($Input1, "")
GUICtrlSetData($Input2, "")
F_Combo()
EndIf
Case $msg = $sclb
$deljz = GUICtrlRead($Combo1)
$del = _StringEncrypt ( 1, $deljz , "lansemengxiangjiamixitong","administrators" )
if $del = "D2C54EC18027CC2A9F2C637D049F2D4E29704D3EC36AE8C3DF54DF34A0D650AB317D287A43447A6A0DF3A5CA0CC02153C5B9882F" then
msgbox(48,"错误","请选择要删除的列表!")
Else
IniDelete ( @ScriptDir & "\连接管理.ini" , "设置" , $del )
F_Combo()
msgbox(48,"提示","删除成功!")
EndIf
EndSelect
WEnd
EndFunc
Func F_Combo()
$ComboList1 = ""
$listz1 = IniReadSection(@ScriptDir & "\连接管理.ini" , "设置" )
For $i = 1 To $listz1[0][0]
$list1 = _StringEncrypt ( 0, $listz1[$i][0] , "lansemengxiangjiamixitong","administrators" )
$ComboList1=$ComboList1&"|"&$List1
Next
GuiCtrlSetData($Combo1,$ComboList1,"------连 接 器 列 表------")
EndFunc
Func cl()
GUISetState ( @SW_SHOW , $Form1 )
EndFunc
Func yc()
GUISetState ( @SW_MINIMIZE , $Form1 )
GUISetState ( @SW_HIDE , $Form1 )
EndFunc
Exit
以前写的,可以参考一下。 |