# Re: 谢了

Posted by 小琳 on July 18, 1999 at 21:15:37:

In Reply to: 谢了 posted by j on July 18, 1999 at 14:22:11:

: : : 如何使用 MMControl 控制项连续播放 .WAV 档

: : : 谢谢

: : :::好像没有支援连续播放的功能，不过使用API函数就有!!!

: API 函数怎么用

:::在Form里面放入一个Timer，程式则如下：
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Private Sub Timer1_Timer()
Dim a As String
mciSendString "close abc", vbNullString, 0, 0
mciSendString "open c:\windows\media\ding.wav alias abc", vbNullString, 0, 0
mciSendString "play abc", vbNullString, 0, 0
a = String(256, Chr(0))
mciSendString "status abc mode", a, Len(a), 0
If Left(a, 7) = "stopped" Or Left(a, 2) = "停止" Then
mciSendString "seek abc to start", vbNullString, 0, 0
mciSendString "play abc", vbNullString, 0, 0
End If
End Sub

Follow Ups:

- Thank You(无内文) j 16:29:16 7/19/99 (0)