1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
'dans un module standard!!!!!
Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Dim maintenant As Long
Sub demarre()
maintenant = 0
SetTimer Application.hWnd, 0, 1000, AddressOf metre_a_l_heure
End Sub
Sub metre_a_l_heure(ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
maintenant = maintenant + 1
If maintenant = 9 Then
MsgBox "coucou c'est l'heure on ferme rentre chez toi"
maintenant=0
byebye
End Sub
Sub byebye()
KillTimer Application.hWnd, 0
End Sub |
Partager