PDA

View Full Version : Code needed for a plank program



Telkomisaloser
13-04-2006, 07:50 PM
Whats the code to open a cd drive?
and also I would like to know the code to close it

I use .net and VB

tibby.dude
13-04-2006, 10:07 PM
You are a rather lazy git.

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 cmdOpenDrive_Click()
Dim OpenCDDrive As Long
OpenCDDrive = mciSendString("set CDAudio door open", "", 127, 0)
End Sub

Private Sub cmdCloseCD_Click()
Dim CloseCD As Long
CloseCD = mciSendString("set CDAudio door closed", "", 127, 0)
End Sub

Telkomisaloser
13-04-2006, 10:48 PM
lol thanks tibby I owe you one :)