|
-
Nov 26th, 1999, 08:37 AM
#1
Thread Starter
Lively Member
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.
-
Nov 26th, 1999, 12:20 PM
#2
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]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|