Use the program to open or close the drive

xiaoxiao2021-03-06  39

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 LongPrivate Declare Function mciGetErrorString Lib "winmm.dll" Alias ​​"mciGetErrorStringA" (Byval Dwerror As Long, Byval LPSTRBUFFER AS STRING, BYVAL ULENGTH AS long) As long

Public function inoutcdrom (Whichcdrom as string, incroy) AS Integerdim Error As string * 255inoutcdrom = mcIndstring ("Open CDAUDIO!" Whichcdrom "Alias ​​mm", 0, 0, 0)

If inoutcdrom <> 0 Then mciGetErrorString inoutcdrom, error, 255 MsgBox error Exit Function End IfIf Not incdrom Theninoutcdrom = mciSendString ( "set mm door open", 0, 0, 0) Elseinoutcdrom = mciSendString ( "set mm door closed", 0, 0, 0) End IFIF INOD INONOUTCDROM = McISendString ("Close MM", 0, 0, 0) End Function Use: Open the CD-ROM: INOUTCDROM Light Drive, False Turns the CD-ROM drive: inoutcDROM light drive character, True

转载请注明原文地址:https://www.9cbs.com/read-77728.html

New Post(0)