Open CD Drive and Close

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
1 post Page 1 of 1
Contributors
User avatar
shekoasinger
New Member
New Member
Posts: 23
Joined: Sat Dec 04, 2010 9:40 pm

Open CD Drive and Close
shekoasinger
To be clear, I didnt write this code but there is not much special about it, you can find it anywhere on the internet. Althought this is the most succesful version.

Declarations:
Code: Select all
Private setTrayStatus As Long
    'API
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
     (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
      ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Open Tray:
Code: Select all
setTrayStatus = mciSendString("Set CDAudio Door Open", Nothing, 0, 0)
Close Tray:
Code: Select all
setTrayStatus = mciSendString("Set CDAudio Door Closed", Nothing, 0, 0)
1 post Page 1 of 1
Return to “Tutorials”