How to Open And Close the cd drive using the API or other ways
Printable View
How to Open And Close the cd drive using the API or other ways
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 Private Sub cmdOpen_Click() 'Open the CD Drive mciSendString "set CDAudio door open", 0, 127, 0 End Sub Private Sub cmdClose_Click() 'Close the CD Drive mciSendString "set CDAudio door closed", 0, 127, 0 End Sub