#include <GUIConstantsEx.au3>
local $counter= 0
Local $boolprocess = 0
Local $hGUI = GUICreate("Example",190,200)
Local $buttonstart = GUICtrlCreateButton("Start", 0, 100, 85, 25)
Local $buttonstop = GUICtrlCreateButton("Stop", 100, 100, 85, 25)
Local $buttoncounter = GUICtrlCreateLabel("", 10, 30,50,50)
GUISetState(@SW_SHOW, $hGUI)
While 1
if ($boolprocess = 1) Then
$counter+=1
GUICtrlSetData($buttoncounter,$counter)
EndIf
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $buttonstart
$boolprocess = 1
Case $buttonstop
$boolprocess = 0
EndSwitch
WEnd
|