-
I have Visual Basic 4.0 32 bit
and for a program I am making I need it to play a wav file when someone clicks on the main picture, can someone help me out with a code? and give me full instructions on where to put each part of the code because I am a real dumb ass.
Thanx.
-
Not much to it, just use the sndPlaySound API, pass it a File Path/Name and the Required Flag.
SND_ASYNC Just allows processing to continue whilst the Sound is being played.
Code:
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Sub Picture1_Click()
sndPlaySound "C:\Windows\Media\CtMelody.wav", SND_ASYNC
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]