vb 中mmcontrol怎么实现音乐播放时的停止和暂停
1个回答
2013-08-15
展开全部
添加mmcontrol控件,在引用中Microsoft Multimedia Control 6.0(sp3)load 中 MMControl1.Notify = False MMControl1.Wait = True MMControl1.Shareable = False MMControl1.DeviceType = "WaveAudio" MMControl1.FileName = "D:\PlatformTicket\Windows 登录音.wav" MMControl1.Command = "Open" MMControl1.Command = "Play"然后可以在定时器里 If MMControl1.mode = 525 Then '检查是否停止 MMControl1.Command = "Prev" MMControl1.Command = "Play" End If进行循环播放最后在unload中 MMControl1.Command = "Close"关闭播放器 或者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 Form_Load() mciSendString "open C:\birthday.mid alias mc", 0, 0, 0 mciSendString "play mc", 0, 0, 0 End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询