Results 1 to 4 of 4

Thread: Api call

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204
    I need to know the API call that allow you to play Window wave file. I built a message board for the desk top and want it to use the wave file to let user know there is a message posted. I not very good with coding API call yet so I'll need a sample. One wave file is Done.wav

  2. #2
    Guest
    Use the sndPlaySound API. Put this code in a module.

    Code:
    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Place a CommandButton on a Form with this code.

    Code:
    Private Sub Command1_Click()
    
       Call sndPlaySound("C:\done.wav", &H1)
    
    End Sub

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

    Unhappy

    ok that works but how do you stop the wav file playing when
    you close the program ?


    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]

  4. #4
    Guest
    This plays WAV file until it is finished. I'm not sure if you can terminate it but I'll look in to it.

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