I wrote a program to eject CD-Rom using mci controls. Only work if, I have a CD inside the CD-Rom. Is anyone know how to eject CD-Rom without any CD inside.
Thanks
Printable View
I wrote a program to eject CD-Rom using mci controls. Only work if, I have a CD inside the CD-Rom. Is anyone know how to eject CD-Rom without any CD inside.
Thanks
This always works for me:
------------------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
'-------Put this on any event
Call mciSendString("Set CDAudio Door open Wait", 0&, 0&, 0&)
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
wow, i would have expected shedloads of code!
Serge, do you know how to ask the drive whether it is open already, and if so, how to close it?
------------------
Wossname,
Email me: [email protected] :)
Use DOOR CLOSED in the Command String, if it's not Open it just won't do anything, eg.
------------------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 Command1_Click()
Static bOpen As Boolean
If Not bOpen Then
Call mciSendString("SET cdaudio DOOR OPEN wait", "", 0, 0)
Else
Call mciSendString("SET cdaudio DOOR CLOSED wait", "", 0, 0)
End If
bOpen = Not bOpen
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]