在下面的代码中,首先播放歌曲,然后显示消息。如何在下面的代码中同时显示消息框和声音播放 ?
Private Declare PtrSafe Function PlaySound Lib "winmm.dll" _Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As LongPtr, ByVal dwFlags As Long) As Boolean
Private Sub CommandButton1_Click()
Call PlaySound("c:\windows\media\tada.wav", 0, SND_ASYNC Or SND_FILENAME)
Msgbox "Process completed successfully."
End Sub
答案 0 :(得分:0)
Private Declare PtrSafe Function PlaySound Lib "winmm.dll" _Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As LongPtr, ByVal dwFlags As Long) As Boolean
Const SND_ASYNC = &H1
Private Sub CommandButton1_Click()
Call PlaySound("c:\windows\media\tada.wav", 0, SND_ASYNC Or SND_FILENAME)
Msgbox "Process completed successfully."
End Sub