|
-
May 16th, 2000, 09:11 PM
#1
Thread Starter
Addicted Member
Hi there, are there any code wizards out there that can tell me how to open and close the CD-ROM drive?
Rohan
-
May 16th, 2000, 09:42 PM
#2
Lively Member
CD-Rom Door Open/Close
RohanWest,
Hope this helps...
Option Explicit
Dim dooropen As Boolean
Private Declare Function mciSendString Lib "winmm.dll" _
Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
pstrReturnString As String, ByVal uReturnLength As Long, ByVal _
wndCallback As Long) As Long
Private Sub cmdClose_Click()
Dim lRet As Long
Dim sRet As Long
If dooropen Then
lRet = mciSendString("set CDAudio door open", sRet, 127, 0)
dooropen = False
Else
lRet = mciSendString("set CDAudio door closed", sRet, 127, 0)
End If
End Sub
Private Sub cmdOpen_Click()
Dim lRet As Long
Dim sRet As Long
If dooropen Then
lRet = mciSendString("set CDAudio door closed", sRet, 127, 0)
dooropen = True
Else
lRet = mciSendString("set CDAudio door open", sRet, 127, 0)
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|