在程序中如何打开和关闭光驱门
【IT168 服务器学院】
API函数声明如下:
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
'' 调用时的代码如下
Dim Ret As Long
Dim RetStr As String
''打开光驱门
Ret = mciSendString("set CDAudio door open", RetStr, 0, 0)
''关闭光驱门
Ret = mciSendString("set CDAudio door closed", RetStr, 0, 0)
0
相关文章