Code to open & close CD-Rom with VB
VB 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
Public Sub OpenCDDriveDoor(ByVal State As Boolean)
If State = True Then
Call mciSendString("Set CDAudio Door Open", 0&, 0&, 0&)
Else
Call mciSendString("Set CDAudio Door Closed", 0&, 0&, 0&)
End If
End Sub
Private Sub Command1_Click()
OpenCDDriveDoor (True)
End Sub
Private Sub Command2_Click()
OpenCDDriveDoor (False)
End Sub
Re: Code to open & close CD-Rom with VB
I'm sure we all appreciate your code contributions, but please post them in the Codebank