Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_LOOP = &H8
Const SND_ASYNC = &H1Private Sub Command1_Click()
'循环播放
sndPlaySound "C:\WIN2000\Media\ringin.wav", SND_ASYNC Or SND_LOOP
End SubPrivate Sub Command2_Click()
'停止播放
sndPlaySound vbNullString, SND_ASYNC
End Sub
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_LOOP = &H8
Const SND_ASYNC = &H1Private Sub Command1_Click()
'循环播放
sndPlaySound "C:\WIN2000\Media\ringin.wav", SND_ASYNC Or SND_LOOP
End SubPrivate Sub Command2_Click()
'停止播放
sndPlaySound vbNullString, SND_ASYNC
End Sub
sndPlaySound ByVal vbNullString, 0&