How do I open and close the CD Drive?
--
Screaming Fist
A witty saying proves nothing.
Printable View
How do I open and close the CD Drive?
--
Screaming Fist
A witty saying proves nothing.
I can't remember where I stole (er, uh, found) this code from, but I hope it helps.
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
public ReturnString as string
public Sub OpenCD()
ReturnString = string$(128, " ")
mciSendString "set CDAudio door open", ReturnString, 127, 0
End Sub
public Sub CloseCD()
ReturnString = string$(128, " ")
mciSendString "set CDAudio door closed", ReturnString, 127, 0
End Sub