I was thinking of just actually making the component but i never learnt how. So if someone can actually help me out I would appreciate it!
Printable View
I was thinking of just actually making the component but i never learnt how. So if someone can actually help me out I would appreciate it!
I need to make a timer component that can have an interval of over 10 minutes.
You could use the Multi Media timer functions. Look the following up in MSDN Library for starters:
timeGetDevCaps()
timeBeginPeriod()
timeEndPeriod()
timeSetEvent()
timeKillEvent()
This is not component code, but I have been playing around with the API that V(ery) Basic posted in response to your original post. I have several labels on the form so I can watch the progress of the tickCount. There is also a text box for entering the interval (in minutes).
This version of the code just waits the amount of time, beeps once, and then starts over again.
Hope it helps.
Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim EndTime As Long
Dim intMinutes As Integer
Private Sub Command1_Click()
intMinutes = Text1.Text
EndTime = GetTickCount + (intMinutes * 60000)
Label2.Caption = GetTickCount
Label3.Caption = EndTime
Label4.Caption = Time
Label5.Caption = DateAdd("n", intMinutes, Time)
Do While EndTime > GetTickCount
Label1.Caption = GetTickCount
DoEvents
Loop
timerDone
End Sub
Private Sub timerDone()
Beep
Call Command1_Click
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
[Edited by jbart on 08-28-2000 at 12:05 PM]