如果你想通过VB打开或者关闭CD-ROM,你可以向Windows Multimedia DLL发出一条相关的命令请求,但是你必须先声明DLL:
在模块文件中加入以下代码:
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/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073