by Lame_Joker (2 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Tue 26th June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Make your CD-ROM drive open using the mciSendString API.
API Declarations
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
1) named "Open"
2) Named "Close"
' Write those lines to open:
Private Sub Open_Click()
mciSendString "Set cdaudio door Open", returnstring, 127, 0
End Sub
' Write those lines to close:
Private Sub Close_Click()
mciSendString "Set cdaudio door Closed", returnstring, 127, 0
End Sub
' Thats all! Try it out by clicking one of the buttons :)