GUICreate(" Win ", 150, 302, 800, 2)
$L1 = GUICtrlCreateLabel("1", 2, 2, 62, 36, 0x00800000) ;$WS_BORDER = 0x00800000
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L2 = GUICtrlCreateLabel("2", 2, 40, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlSetFont(-1, 24)
$L3 = GUICtrlCreateLabel("3", 2, 78, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$1Button = GUICtrlCreateButton("往下要循環", 65, 1, 80, 30)
$2Button = GUICtrlCreateButton("原地執行", 65, 31, 80, 30)
$3Button = GUICtrlCreateButton("往上不循環", 65, 62, 80, 30)
GUISetState()
Dim $bj = $L2
Dim $exe[3] = ['C:\程式1(aaa).exe', 'C:\程式2(bbb).exe', 'C:\程式3(ccc).exe']
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $1Button, $3Button
Go($msg)
Case $2Button
MsgBox(0, 0, $exe[$bj - 3], 1)
EndSwitch
WEnd
Func Go($msg)
If ($msg = $3Button And $bj = $L1) Then Return ;Or ($msg = $3Button And $bj = $L1)
GUICtrlSetBkColor($bj, 0xFFFFFF)
$bj += 1
If $msg = $3Button Then $bj -= 2
If $msg = $1Button And $bj = $L3 + 1 Then $bj = $L1
GUICtrlSetBkColor($bj, 0xFF0000)
MsgBox(0, 0, $exe[$bj - 3], 1)
EndFunc ;==>Go