Per aprire e chiudere il casetto del lettore CD:
codice:
Option Explicit
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
Dim returnstring As Long, retvalue As Long
'---------------------------------------------------------------
Private Sub Command1_Click()
'Apre il CD
retvalue = mciSendString("set CDAudio door open", _
returnstring, 127, 0)
End Sub
'---------------------------------------------------------------
Private Sub Command2_Click()
'Chiude il CD
retvalue = mciSendString("set CDAudio door closed", _
returnstring, 127, 0)
End Sub