#include <ComboConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
$Form1 = GUICreate("进度条", 380, 200)
$Progress1 = GUICtrlCreateProgress(50, 50, 260, 30)
$Button1 = GUICtrlCreateButton("开始", 150, 150, 80, 30, $WS_GROUP)
$Button2 = GUICtrlCreateButton("退出", 240, 150, 80, 30, $WS_GROUP)
$Combo1 = GUICtrlCreateCombo("1", 210, 100, 80, 50)
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|", "1")
$Label1 = GUICtrlCreateLabel("选择安装软件的数量:", 50, 100, 160, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("0%", 320, 53, 50, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3,$Button2
Exit
Case $Button1
kaishi()
EndSwitch
WEnd
Func kaishi()
$a = GUICtrlRead($Combo1)
$b = Int (100 / $a)
$z = 1
For $i = 1 To 100
GUICtrlSetData($Progress1,$i)
GUICtrlSetData($Label2,$i&"%")
$c = GUICtrlRead($Progress1)
$d = IsInt($c / $b )
If $d = 1 Then
MsgBox(0,"","已经安装"&$z&"个软件")
$z += 1
EndIf
Next
EndFunc