Use the following API call to play the WAV file:
Option Compare Database
Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Public Sub x()
Dim retval As Long ' return value of the function
' Play the sound. This function returns when the sound is done.
retval = PlaySound("SystemStart", 0, SND_ALIAS Or SND_SYNC)
' Now loop the .wav file
retval = PlaySound("C:\winnt\media\Windows NT Logon Sound.wav", 0, SND_FILENAME Or SND_ASYNC Or SND_NODEFAULT Or SND_LOOP)
Sleep = 5000 ' wait for 5 seconds while sound loops
retval = PlaySound("", 0, SND_PURGE Or SND_NODEFAULT) ' stop playback
End Sub
Ed Metcalfe.
Please do not feed the trolls.....