Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <MsgBoxConstants.au3>
- HotKeySet("{f1}", "begin")
- HotKeySet("{f3}", "pause")
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 336, 72, 192, 124)
- $btn_begin = GUICtrlCreateButton("Start Click", 16, 16, 137, 33)
- $btn_pause = GUICtrlCreateButton("Pause / Resume", 184, 16, 137, 33)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $btn_begin
- begin()
- Case $btn_pause ; if i press f3 func begin() is pause, but when i click button pause not work, why?
- pause()
- EndSwitch
- WEnd
- Func begin()
- While 1
- ToolTip('Script is Running"', 500, 500)
- Delay(1000)
- WEnd
- EndFunc ;==>begin
- Func pause()
- ToolTip('Script is Paused"', 500, 500)
- MsgBox(0, "Paused", "Press OK to continue..")
- EndFunc ;==>pause
- Func Delay($sleep)
- For $i = 0 to $sleep
- Sleep(10)
- If GUIGetMsg() = $btn_pause Then
- pause()
- ExitLoop
- EndIf
- next
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement