Snippet
'private field:
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
'use this code to open the tray:
setTrayStatus = mciSendString("Set CDAudio Door Open", Nothing, 0, 0)
'use this code to close the tray:
setTrayStatus = mciSendString("Set CDAudio Door Closed", Nothing, 0, 0)
Copy & Paste
|