mciSendString 播放视频文件 获取时间不正确
'载入视频
mciCommand = "open " & ShortPathName & " type MPEGVideo alias " & alias
mciCommand = mciCommand & " parent " & destPic.hwnd & " style child"
nReturn = mciSendString(mciCommand, 0&, 0, 0)
''''''''''''''获取时间
Public Function Duration(sAlias As String) As Long
Dim nReturn As Long, nLength As Long
Dim sLength As String * 64
If sAlias = "" Then
Duration = 0
Exit Function
End If
nReturn = mciSendString("Status " & sAlias & " length", sLength, 64, 0)
nLength = InStr(sLength, Chr$(0))
Duration = Val(Left$(sLength, nLength - 1))
End Function