Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GUIConstantsEx.au3>
- Global $was_stop = 0
- GUICreate("My GUI Button")
- $Button_1 = GUICtrlCreateButton("Button_1", 10, 30, 100)
- $Button_2 = GUICtrlCreateButton("Button_2", 120, -1)
- GUISetState()
- While 1
- $msg = GUIGetMsg()
- Select
- Case $msg = $GUI_EVENT_CLOSE
- ExitLoop
- Case $msg = $Button_1
- _Function1()
- EndSelect
- WEnd
- Func _Function1()
- $was_stop = 0
- for $i=1 to 100
- While 1
- If IsStop() Then Return
- ConsoleWrite("running" & @CRLF)
- ; some code 1
- ; ...
- ;If IsStop() Then Return
- ; some code 2
- ConsoleWrite("runningaaaa" & @CRLF)
- Sleep(100)
- ExitLoop
- WEnd
- While 1
- If IsStop() Then Return
- ConsoleWrite("runningccccc" & @CRLF)
- ; some code 1
- ; ...
- ;If IsStop() Then Return
- ; some code 2
- ConsoleWrite("runningaaaabbbbb" & @CRLF)
- ConsoleWrite("runningaaaabbbbbcccc" & @CRLF)
- Sleep(100)
- ExitLoop
- WEnd
- Next
- EndFunc
- Func IsStop()
- If $was_stop Then Return 1
- If GUIGetMsg() = $Button_2 Then
- $was_stop = 1
- Return 1
- EndIf
- Return 0
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement