by Fast 26/11/12, 07:06 pm
ประมาณนี้
#include
#include
#include
Global $Pause = True
AdlibRegister("pause",10)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 218, 190, 576, 198)
$Button1 = GUICtrlCreateButton("กดเริ่ม", 88, 40, 75, 25)
$Button2 = GUICtrlCreateButton("หยุดและไม่หยุด", 88, 88, 85, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
bt1()
EndSwitch
WEnd
Func bt1()
$i = 1
While 1
if $Pause = True then
$i=$i+1
ToolTip($i)
Sleep(100)
EndIf
WEnd
EndFunc
Func Pause()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
$Pause = NOT $Pause
EndSwitch
EndFunc