怎样打开或关闭CD-ROM
【打印文章】
如果你想通过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)
在模块文件中加入以下代码:
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)
本栏文章均来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。( Pfan.cn )
【编程爱好者论坛】