-
Does anyone know how to add simple sounds to a vb program? right now i am only looking for simple sounds like *.wav sounds i would especially want to play sounds like the defualt windows sounds. If you can help me out or point me in the right direction it would be appreciated.
thanks
doug
-
Look up the PlaySound API at either http://www.vbapi.com or in MSDN, it lets you play sounds out of resource files, default windows sounds, and .wav files
-
Here is an example of how to use the PlaySound api function:
Code:
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule _
As Long, ByVal dwFlags As Long) As Long
Private Sub Command1_Click()
PlaySound "C:\MyFile.wav", 0&, &H1
End Sub