i want the code to eject a cd rom and then code to make the tray go back in to the computer.
thanks
Printable View
i want the code to eject a cd rom and then code to make the tray go back in to the computer.
thanks
Make a Form with 2 CommandButtons. Call them cmdOpen and cmdClose.
Code: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
Private Sub cmdOpen_Click()
' Open the CD Drive
mciSendString "set CDAudio door open", t, 127, 0
End Sub
Private Sub cmdClose_Click()
' Close the CD Drive
mciSendString "set CDAudio door closed", t, 127, 0
End Sub
i got two cd-roms in my computer. how can i get it to eject the other one? (it only eject the d:)
I have the same problem have you found a code sample ??
Can someone post some code on how to check if the CD tray is open or closed.