| 首页 | 新闻 | 网页 | 设计 | 色彩 | 原创 | 视觉 | 素材 | 动漫 | 酷站 | 策划 | 文案 | 访谈 | 运营 | 编程 | 数据库 | 服务器 | 下载 | 图库 | 
您的位置: 幽幽天空 > 网页 > 编程开发 > VB教程 > 文章正文 用户登录
Blog站点如何用RS
如何优化Blog来提
如何从博客赚钱。
Web 2.0,如何创造
如何发挥Blog的互
企业如何进行博客
如何建立自己的博
如何从博客赚钱
请问如何利用博客
如何推广你的博客

如 何 用 API 播 放 CD           

如 何 用 API 播 放 CD

作者:佚名 来源:csdn 更新:2006-8-25 21:05:35 错误报告 我要投稿
'Author: Gordon F. MacLeod
' How to play a CD Audio disc via API

' Declare the following API
Declare Function mciSendString& Lib "MMSYSTEM" (ByVal lpstrCommand$,ByVal lpstrReturnStr As Any, ByVal wReturnLen%, ByVal hCallBack%)

'Add the code below to appropriate routines

Sub cmdPlay_Click ()
  Dim lRet As Long
  Dim nCurrentTrack As Integer

  'Open the device
  lRet = mciSendString("open cdaudio alias cd wait", 0&, 0, 0)

  'Set the time format to Tracks (default is milliseconds)
  lRet = mciSendString("set cd time format tmsf", 0&, 0, 0)

  'Then to play from the beginning
  lRet = mciSendString("play cd", 0&, 0, 0)

  'Or to play from a specific track, say track 4
  nCurrentTrack = 4
  lRet = mciSendString("play cd from" & Str(nCurrentTrack), 0&, 0, 0)

End Sub
 

' Remember to Close the device when ending playback

Sub cmdStop_Click ()
  Dim lRet As Long

  'Stop the playback
 
lRet = mciSendString("stop cd wait", 0&, 0, 0)

  DoEvents  'Let Windows process the event

  'Close the device
 
lRet = mciSendString("close cd", 0&, 0, 0)

End Sub

文章录入:skyuu    责任编辑:skyuu 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    发表评论:
    姓名:  评 分: 1分 2分 3分 4分 5分
     
  • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
  • 用户需对自己在使用幽幽天空服务过程中的行为承担法律责任。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表机友个人观点,与本网站立场无关。