Open and close the CD rom door from code! Note:comment out the unneeded api declaration (16 or 32 bit) depending on what operating system you are using!
Original Author: Visual Basic On Line User Group
API Declarations
‘for 16 bit windows
Declare Function mcisendstring Lib “MMSystem” (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal wReturnLength As Integer, ByVal hCallback As Integer) As Long
‘Note:FOR 95/98/NT using the following:
Public 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
Code
'to open it:
x=
mciSendString("set cd door open", 0&,
0, 0)
'to close it:
x = mciSendString("set
cd door closed", 0&, 0, 0)