如何用mciExecute判断一首歌曲是否播放完毕?

解决方案 »

  1.   

    Dim s As String
    s = SendComReturnString("status " & AN & " mode")
    if s='stoped" Then
    '播放完毕
    End If
      

  2.   

    抱歉,忘了给出SendCComreturnstring的脚本了 
    Private Function SendComReturnString(com As String) As String
    Dim FeedBack As Long, ReturnString As String * 255
    ReturnString = String(255, Chr(0))
    FeedBack = mciSendString(com, ReturnString, 255, 0)
    If FeedBack Then
        Dim s As String * 255
        mciGetErrorString FeedBack, s, 255
        MsgBox s, , "MciPlayer"
        SendComReturnString = vbNullString
    Else
        SendComReturnString = Left(ReturnString, InStr(1, ReturnString, Chr(0)) - 1)
    End If
    End Function
      

  3.   

    我这里也有一个:
    稍微祥细一点的代码
    通过Slider1控件可以判断是否播放完毕:  Slider1.Value=Slider1.Max 表示播放完毕 
    http://blog.csdn.net/chenjl1031/archive/2007/12/24/1964909.aspx