1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Public Declare Function timeSetEvent Lib "winmm.dll" (ByVal uDelay As Long, _
ByVal uResolution As Long, ByVal lpFunction As Long, _
ByVal dwUser As Long, ByVal uFlags As Long) As Long
Public Declare Function timeKillEvent Lib "winmm.dll" (ByVal uID As Long) As Long
Public Const TIME_PERIODIC = 1
Public Const TIME_CALLBACK_FUNCTION = &H0
Public mon_timer As Long, battement_timer As Long
Public Sub demarrons_timer()
mon_timer = timeSetEvent(battement_timer, 0, AddressOf procedure_timer, 0, _
TIME_PERIODIC Or TIME_CALLBACK_FUNCTION)
End Sub
Public Sub stoppons_timer()
timeKillEvent mon_timer
mon_timer = 0
End Sub
Public Sub procedure_timer(ByVal uID As Long, ByVal uMsg As Long, ByVal dwUser As Long, _
ByVal dw1 As Long, ByVal dw2 As Long)
' à toi de mettre ici les instructions que tu veux
'en lieu et place de ce petit affichage d'heure en démo !
UserForm1.Label1.Caption = Now
End Sub |