|
-
Aug 28th, 2000, 10:16 AM
#1
Thread Starter
Fanatic Member
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!
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Aug 28th, 2000, 10:17 AM
#2
Thread Starter
Fanatic Member
I need to make a timer component that can have an interval of over 10 minutes.
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Aug 28th, 2000, 10:28 AM
#3
You could use the Multi Media timer functions. Look the following up in MSDN Library for starters:
timeGetDevCaps()
timeBeginPeriod()
timeEndPeriod()
timeSetEvent()
timeKillEvent()
-
Aug 28th, 2000, 10:40 AM
#4
Fanatic Member
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]
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
|