|
-
Apr 4th, 2001, 08:56 AM
#1
Thread Starter
Frenzied Member
-
Apr 4th, 2001, 08:07 PM
#2
Thread Starter
Frenzied Member
-
Apr 5th, 2001, 07:00 PM
#3
Sorry, the 2nd argument is the WM_TIMER message. The 3rd argument is the timer ID (the ID you use to distinguish them)
-
Apr 8th, 2001, 09:30 AM
#4
Thread Starter
Frenzied Member
-
Apr 9th, 2001, 06:09 AM
#5
PowerPoster
hehe... Megatron does not get enough sleep 
Code:
'//Put this code under a Form
Option Explicit
Private Sub Form_Load()
'//Create 3 Timer
SetTimer Me.hwnd, 0, 1000, AddressOf TimerProc
SetTimer Me.hwnd, 1, 2000, AddressOf TimerProc
SetTimer Me.hwnd, 2, 3000, AddressOf TimerProc
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'//Kill all 3 timer
KillTimer Me.hwnd, 0
KillTimer Me.hwnd, 1
KillTimer Me.hwnd, 2
End Sub
'//Put this code under a module
Option Explicit
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
Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
Select Case uElapse
Case 0
Form1.List1.AddItem "Timer 0 callback"
Case 1
Form1.List1.AddItem "Timer 1 callback"
Case 2
Form1.List1.AddItem "Timer 2 callback"
End Select
End Sub
'Code improved by vBulletin Tool (Save as...)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|