MCI Command String总览[1]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

MCI Command String总览

  (注:本文以2000年七月的MSDN解释为准)

 

MCI Command String是多媒体设备的程序接口。通过它,我们可以打开一个多媒体文件,例如mp3VCDMpeg4格式的文件等等,并对它进行播放,暂停,关闭等操作。现在小弟有幸给大家介绍一下MCI Command String的使用方法。

MCI Command String是通过mciExecutemciSendString两个函数执行的。这两个函数的声明如下:

Private Declare Function mciExecute Lib "winmm.dll" Alias "mciExecute" (ByVal lpstrCommand As String) As Long

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

这两个函数都有一个叫lpstrCommand的参数, 这个参数就是我们今天要介绍的MCI Command String。其中函数mciSendString还有三个参数,lpstrReturnString是一个字符串,它用来接收mciSendString函数返回的信息(例如,我们在lpstrCommand中的命令是让函数返回打开的文件的设备类型,那么函数就把设备类型的信息保存在lpstrReturnString参数中。);uReturnLength参数用来指定参数lpstrReturnString的长度;hwndCallback是接收“wait”、“notify”消息的窗口句柄,在Visual Basic中调用时该参数设为0即可。

本文关键:MCI Command String总览
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top