yellowTIGER
May 21st, 2001, 02:42 PM
Hello,
What do you have to do so that an audio file (ie wave) is played when a command is clicked?
Thanks in advance for the help.
--yellowTIGER--
RSH
May 21st, 2001, 10:29 PM
Try This
Put this at the top of your code
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal _ '(end of first line)
'Below goes on one line
lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
'Put below in your code
Private Sub Command1_Click()
'Below goes on one line
retVal = PlaySound("C:\WINDOWS\MEDIA\The Microsoft Sound.Wav", 0&, &H20000)
End Sub
73 RSH
You can substitute the name of any wave file in above. this one I believe is the windows welcome sound.