Results 1 to 3 of 3

Thread: Playing a wav file

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Unhappy

    How do I play a wav file when a form is loaded?? I have tried many examples I have found on the web with no sucess. I would like it to play when the form is loaded and only play once.


    Thanks,

    Kevin

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

    Code:
    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Now add this code to the Form's Initialize event

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

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Seattle, WA, USA
    Posts
    46

    Smile

    Thanks. That worked great!

    Kevin

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