Option Explicit
'播放音乐
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_SYNC As Long = &H0
Public Const SND_ASYNC As Long = &H1
Public Const SND_NODEFAULT As Long = &H2
Public Const SND_LOOP As Long = &H8
Public Const SND_NOSTOP As Long = &H10
Public Sub PlayWav(SoundName As String)
Dim wFlags As Long, X As Long
wFlags = SND_ASYNC Or SND_NODEFAULT
If len(Dir(SoundName) )<4 Then
X = sndPlaySound(SoundName, wFlags)
End If
End Sub
VB QQ群:47715789