PDA

Click to See Complete Forum and Search --> : Entering TimeValue


ANI
Dec 5th, 1999, 11:41 AM
Hi, I have MIDI sound file and want my pc to play this sound at 1:30:30 PM. outomatically when the pc is on. having problem with the rigt way of entering hours,minutes and seconds.

THANKS;

Serge
Dec 5th, 1999, 06:17 PM
You can create a small application with a Timer control on it. Drop as Timer control on a Form and change it's Interval property to 1000


Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long


Private Sub Timer1_Timer()
Static dtTime As Date
Dim lRet As Long
Dim strMidi As String

dtTime = Time
If dtTime = #1:30:30 AM# Then
strMidi = "C:\MyFolder\MyMIDI.mid"
lRet = mciSendString("open " & strMidi & " Type sequencer Alias MFile", 0&, 0, 0)
lRet = mciSendString("play MFile", 0&, 0&, 0&)
End If
End Sub



------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)