I need some help playing a .wav file when a form opens. Someone told me I need to use API so I thought i'd post here.
Printable View
I need some help playing a .wav file when a form opens. Someone told me I need to use API so I thought i'd post here.
Use the PlaySound API function.
VB 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