#include <WindowsConstants.au3>
GUICreate("进度条", 380, 200)
GUISetFont(12, 400, 0, "MS Sans Serif")
$Progress1 = GUICtrlCreateProgress(50, 50, 260, 30)
$But1 = GUICtrlCreateButton("开始", 200, 150, 60, 30, $WS_GROUP)
$But2 = GUICtrlCreateButton("退出", 280, 150, 60, 30, $WS_GROUP)
$Combo1 = GUICtrlCreateCombo("1", 210, 100, 80, 50)
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|", "1")
GUICtrlCreateLabel("选择安装软件的数量:", 50, 100, 160, 24)
$Label2 = GUICtrlCreateLabel("0%", 320, 53, 50, 24)
$Label3 = GUICtrlCreateLabel("已安装软件数量:0", 20, 155, 160, 24)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3, $But2
Exit
Case $But1
begin(GUICtrlRead($Combo1))
EndSwitch
WEnd
Func begin($sAmount)
$z = 1
For $i = 1 To 100
GUICtrlSetData($Progress1, $i)
GUICtrlSetData($Label2, $i & "%")
$sP = GUICtrlRead($Progress1)
$var = IsInt($sP / Int(100 / $sAmount))
If $var = 1 Then
GUICtrlSetData($Label3, "已安装软件数量:" & $z & ' / ' & $sAmount)
$z += 1
Sleep(1000)
EndIf
If $sP = "100" Then MsgBox(0, "提示", "安装完成")
Next
EndFunc ;==>begin