-
playing a wav file
I have VB6 and I am trying to attach a wav file to a command button, so when
the button is pushed, a
sound will be played. Any one know how to do it?
thanks
cal
-
Re: playing a wav file
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Const SND_FILENAME = &H20000 ' Name is a file name.
'Selected is a choice I make from
Private Sub mnuChooseSoundItem_Click()
CommonDialog1.Filter = "WaveFiles (*.WAV)|*.WAV"
CommonDialog1.ShowOpen
Selected = CommonDialog1.FileName
End Sub
' the following in the event procedure
Call PlaySound(Selected, 0, SND_FILENAME)
cal <sticks2@earthlink.net> wrote in message
news:39ef7b82$1@news.devx.com...
>
> I have VB6 and I am trying to attach a wav file to a command button, so
when
> the button is pushed, a
> sound will be played. Any one know how to do it?
>
>
> thanks
> cal
-
Re: playing a wav file
Jim---I could not get the code to work.
thanks
cal
>
>
>
>
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
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|