Je cherche une fonction qui lance un fonction sans qu'elle ne stop la GUI
Je sais que sa existe mais je ne sais plus comment elle s'appelle ...
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
local $min = 5, $sec = 0, $Compteur = true
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 459, 206, 189, 120)
GUISetFont(72, 400, 0, "Arial")
GUISetBkColor(0x000000)
Global $Label1 = GUICtrlCreateLabel($min, 88, 0, 110, 111)
GUICtrlSetColor(-1, 0xFF0000)
Global $Label2 = GUICtrlCreateLabel(":", 200, 0, 31, 111)
GUICtrlSetColor(-1, 0xFFFFFF)
Global $Label3 = GUICtrlCreateLabel($sec, 232, 0, 110, 111)
GUICtrlSetColor(-1, 0xFF0000)
Global $Input1 = GUICtrlCreateInput("", 8, 144, 369, 26)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
Global $Button1 = GUICtrlCreateButton("Valid", 376, 144, 75, 25, $WS_GROUP)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
If $Compteur = true Then
_Secondes()
EndIf
WEnd
Func _Secondes()
If $sec = "0" Then
$sec = 59
_Minutes()
GUICtrlSetData($Label3,$sec)
EndIf
Sleep(1000)
$sec = $sec - 1
If $sec = "9" Or $sec = "8" Or $sec = "7" Or $sec = "6" Or $sec = "5" Or $sec = "4" Or $sec = "3" Or $sec = "2" Or $sec = "1" Or $sec = "0" Then
GUICtrlSetData($Label3,"0"&$sec)
Else
GUICtrlSetData($Label3,$sec)
EndIf
EndFunc
Func _Minutes()
If $min = "0" Then
MsgBox(0,"Compte à rebourd","Le temps est fini!")
$Compteur = False
EndIf
$min = $min - 1
If $sec = "9" Or $min = "8" Or $min = "7" Or $min = "6" Or $min = "5" Or $min = "4" Or $min = "3" Or $min = "2" Or $min = "1" Or $min = "0" Then
GUICtrlSetData($Label1,"0"&$min)
Else
GUICtrlSetData($Label1,$min)
EndIf
EndFunc
Merci
