Eine Möglichkeit wäre diese (über eine Variable)
Spoiler anzeigen
[autoit]
#include <GUIConstantsEx.au3>
GUICreate("Test")
GUISetState()
$status = 1
$Button = GUICtrlCreateButton("Start", 8, 37, 262, 20, 0)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
If $status = 1 Then
MsgBox(0, "", "Start")
GUICtrlSetData($Button, "Stop")
$status = 0
Else
MsgBox(0, "", "Stopp")
GUICtrlSetData($Button, "Start")
$status = 1
EndIf
EndSwitch
WEnd
Edit: Mist :wacko: zu langsam, aber gleiche Idee ![]()