在模块文件中加入以下代码:
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
以下是打开CD-ROM的过程代码:
retvalue = mcisendstring("set CDAudio door open", _
returnstring, 127, 0)
关闭CD-ROM用以下代码:
retvalue = mcisendstring("set CDAudio door closed", _returnstring, 127, 0)
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/