Public Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Public Const SND_ASYNC& = &H1
Public Const SND_NODEFAULT& = &H2
Public Const SND_RESOURCE& = &H40004
Public Sub PlayResSound(strSound As String)
Dim lFlags As Long
Dim lRet As Long
Dim hInst As Long
lFlags = SND_RESOURCE + SND_ASYNC + SND_NODEFAULT
hInst = App.hInstance
lRet = PlaySound(strSound, hInst, lFlags)
End Sub
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
------------------ 程序中----------------
PlaySound "F:\test.wav", 0, 0
----------------------------------------
不是可以吗?