
Code : Tout sélectionner
Procedure TimerProc(hwnd, uMsg, idEvent, dwTime)
Debug "Coucou!!!"
EndProcedure
SetTimer_(#Null,1,2000,@TimerProc())
Quelqu'un sait-il comment utiliser un Timer sans avoir de fenêtre???
Chris

Code : Tout sélectionner
Procedure TimerProc(hwnd, uMsg, idEvent, dwTime)
Debug "Coucou!!!"
EndProcedure
SetTimer_(#Null,1,2000,@TimerProc())
Code : Tout sélectionner
Global Quit
Procedure TimerProc(hwnd, uMsg, idEvent, dwTime)
Debug "Coucou!!!"
Quit=Quit+1
EndProcedure
Enumeration
#Window
EndEnumeration
If OpenWindow(#Window,0,0,400,400,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Pure Basic")
SetTimer_(0,1,1000,@TimerProc())
Repeat
EventID.l=WaitWindowEvent()
; Select EventID
; Case #WM_TIMER
; Debug "Timer"
; EndSelect
Until Quit=10
EndIf
Code : Tout sélectionner
Procedure TimerProc()
Debug "Coucou!!!"
EndProcedure
Enumeration
#Window
EndEnumeration
If OpenWindow(#Window, 0, 0, 400, 400, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Pure Basic")
SetTimer_(0, 0, 1000, @TimerProc())
Repeat
EventID.l = WaitWindowEvent()
Until EventID = #WM_CLOSE
EndIf
Code : Tout sélectionner
Procedure TimerProc(Intervalle_de_temps.l)
Chronometre = ElapsedMilliseconds()
Repeat
If ElapsedMilliseconds() - Chronometre => Intervalle_de_temps
Chronometre = ElapsedMilliseconds()
Debug "Coucou " + Str(ElapsedMilliseconds())
Sleep_(1)
EndIf
Sleep_(1)
ForEver
EndProcedure
;
;
;
Numero_Thread = CreateThread(@TimerProc(), 2000)
Repeat
ForEver
End
Code : Tout sélectionner
Procedure TimerProc()
Debug "Coucou!!!"
EndProcedure
Enumeration
#Window
EndEnumeration
SetTimer_(0, 0, 1000, @TimerProc())
If OpenWindow(#Window, 0, 0, 400, 400, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Pure Basic")
Repeat : Until WaitWindowEvent() = #WM_CLOSE
EndIf
ChrisThe TimerProc function is an application-defined callback function that processes WM_TIMER messages.
VOID CALLBACK TimerProc( HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime
);
Parameters
hwnd
[in] Handle to the window associated with the timer.
uMsg
[in] Specifies the WM_TIMER message.
idEvent
[in] Specifies the timer's identifier.
dwTime
[in] Specifies the number of milliseconds that have elapsed since the system was started. This is the value returned by the GetTickCount function.
Code : Tout sélectionner
#Button_Minimize = 1
#Etat_Fenetre = #SW_HIDE
; #Etat_Fenetre = #SW_MINIMIZE
Procedure TimerProc(hwnd, uMsg, idEvent, dwTime)
SetWindowText_(hWnd, "Chronomètre caché : Coucou à " + FormatDate("%hh:%ii:%ss", Date()))
EndProcedure
;
;
;
If OpenWindow(0, 0, 0, 320, 240, #PB_Window_Invisible, "Chronomètre caché")
ShowWindow_(WindowID(), #Etat_Fenetre)
SetTimer_(WindowID(), 1, 2000, @TimerProc())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
End
Le Soldat Inconnu a écrit :euh, comme çà, ça marche mais il faut quand même une fenêtre
Code : Tout sélectionner
Procedure TimerProc() Debug "Coucou!!!" EndProcedure Enumeration #Window EndEnumeration If OpenWindow(#Window, 0, 0, 400, 400, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Pure Basic") SetTimer_(0, 0, 1000, @TimerProc()) Repeat EventID.l = WaitWindowEvent() Until EventID = #WM_CLOSE EndIf