GUIOnEventMode.
Spoiler anzeigen
[autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode",1)
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 409, 269, 192, 124)
$Button1 = GUICtrlCreateButton("abbrechen", 248, 216, 121, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1,"_Abbrechen")
$Progress1 = GUICtrlCreateProgress(32, 112, 329, 33)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
$bProgress = True
While 1 * Sleep(10)
For $i = 0 To 100
Sleep(100)
GUICtrlSetData($Progress1, $i)
Next
WEnd
Func _Abbrechen()
Exit
EndFunc ;==>_Abbrechen