#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
$a = '自解压文件路径'
$b = '解压路径(监视目录)'
$c = '监视解压进度条'
$gui1 = GUICreate($c, 400, 130)
$button1 = GUICtrlCreateButton("执行解压及监视进度(Enter)", 180, 55, 210, 22)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
$zjy = GUICtrlCreateInput($a, 5, 5, 310, 20)
$ll1 = GUICtrlCreateButton("浏览", 320, 4, 70, 22)
$jylj = GUICtrlCreateInput($b, 5, 30, 310, 20)
$ll2 = GUICtrlCreateButton("浏览", 320, 29, 70, 22)
$wjzs = GUICtrlCreateLabel("压缩包内文件总数:", 6, 59, 105, 20)
$zssr = GUICtrlCreateInput("", 110, 55, 50, 20, $ES_NUMBER)
$jdt = GUICtrlCreateProgress(5, 100, 390, 15)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ll1
$sTmpFile = FileOpenDialog("选择文件:", '', "自解压文件(*.exe)", 7)
If @error Then ContinueLoop
GUICtrlSetData($zjy, $sTmpFile)
Case $ll2
$wjj = FileSelectFolder("选择文件夹,这里必须为自解压的释放文件夹,否则监视没意义。没有的话可以先新建。", "", 3)
If @error Then ContinueLoop
GUICtrlSetData($jylj, $wjj)
Case $button1
If GUICtrlRead($zssr) = '' Or GUICtrlRead($zjy) = $a Or GUICtrlRead($jylj) = $b Then
MsgBox(262192, '问题', '请输入完整信息')
Else
jd()
MsgBox(262208, '完成', '解压完成 ')
EndIf
EndSwitch
WEnd
Func jd()
Run(GUICtrlRead($zjy))
Do
$a = DirGetSize(GUICtrlRead($jylj), 1)
GUICtrlSetData($jdt, $a[1] / GUICtrlRead($zssr) * 100)
Sleep(10)
Until $a[1] = GUICtrlRead($zssr)
EndFunc ;==>jd