VB mciSendString(Api)如何循环播放音乐?
私有声明函数mciSendStringA Lib " winmm . dll "(ByVal lpstrCommand为String,ByVal lpstrReturnString为String,ByVal uReturnLength为Long,ByVal hwndCallback为Long)为Long
私有子命令1_Click()
一边做一边1
调用mcisendstring a(" open c:/1 . MP3 type mpeg视频别名MP3 ",vbnullstring,0,0)' open 1.mp3
调用mciSendStringA("播放MP3等待",vbNullString,0,0)
调用mciSendStringA("关闭MP3 ",vbNullString,0,0)
环
末端接头
方法二:MCI指令重复(推荐,楼上,你提供的代码可以改进,C:/1.mp3可以用假名mp3(或者其他),用起来更方便)。
私有声明函数mciSendStringA Lib " winmm . dll "(ByVal lpstrCommand为String,ByVal lpstrReturnString为String,ByVal uReturnLength为Long,ByVal hwndCallback为Long)为Long
私有子命令1_Click()
调用mcisendstring a(" open c:/1 . MP3 type mpeg视频别名MP3 ",vbnullstring,0,0)' open 1.mp3
调用mciSendStringA("播放MP3重复播放",vbNullString,0,0)
末端接头
私有子窗体_Unload(取消为整数)
调用mciSendStringA("关闭MP3 ",vbNullString,0,0)
末端接头