Results 1 to 3 of 3

Thread: Please Help Me

  1. #1

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604

    Exclamation

    i have forgotten how to make a midi

    file play continualsly (pardon the spelling)

    until a box is checked

    CAN ANYONE HELP ME ???

    Merlin ?

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  2. #2
    Guest
    Put this code in a module. Also, put a CommandButton and a CheckBox on the Form.

    Code:
    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
    Put these 2 functions in the module.

    Code:
    Public Sub LoadMusic(path As String)
    Dim shortPath As String * 128
    Dim shortPath2 As String
    Dim counter As Integer
    Dim chr As String
    GetShortPathName path, shortPath, 128
    Do Until chr = "."
        counter = counter + 1
        chr = Mid(shortPath, counter, 1)
    Loop
    counter = counter + 3
    shortPath2 = Mid(shortPath, 1, counter)
    mciSendString "open " & shortPath2 & " type sequencer alias background", 0, 0, 0
    End Sub
    
    Public Function getMIDIStatus() As Integer
    Dim statusString As String * 255
    getMIDIStatus = 1
    mciSendString "status background mode", ByVal statusString, 255, 0
    If Left(statusString, 7) = "playing" Then getMIDIStatus = 0
    If Left(statusString, 6) = "paused" Then getMIDIStatus = 0
    End Function
    Put this in your CommandButton

    Code:
    Private Sub Command1_CLick()
    
    mciSendString "open C:\MyMidi.mid type sequencer alias background", 0, 0, 0
    mciSendString "play background", 0, 0, 0
    
    End Sub
    Put this in your CheckBox

    Code:
    Private Sub Check1_Click()
    
    'Stops the music when the box is checked
    If Check1.Value = Checked Then
       mciSendString "close background", 0, 0, 0
    End If
    
    End Sub
    [Edited by Megatron on 05-21-2000 at 09:23 AM]

  3. #3

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604

    Talking

    thanks that works really well now

    thanks again

    Merlin ?

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

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