Can someone share the necessary code for playing the sound files included with windows when one hits like a command button. One button for each file would be fine.
73 RSH
Printable View
Can someone share the necessary code for playing the sound files included with windows when one hits like a command button. One button for each file would be fine.
73 RSH
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_sYNC = &H0
Public Const SND_aSYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_MEMORY = &H4
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10
Call this sub each time you click on a command button
Sub PlaySoundClick()
Dim X As Long
Dim wFlag As Integer
Dim SoundName As String
wFlag = SND_aSYNC Or SND_NODEFAULT
X = sndPlaySound("C:\Archive\sound1.tmp", wFlag)
End Sub