Results 1 to 2 of 2

Thread: Entering TimeValue

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    COLUMBUS, OHIO
    Posts
    4

    Post

    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;

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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

    Code:
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width