-
»TFK L!NK3R».
User deleted
Condividi
Create un nuovo progetto mettendo due button:
Button1=Chiudi
Button2=Apri
Cancellate
tutto e scrivete (ma per davvero scrivetelo voi se volete imparare a programmare) questo codice sorgente:
Codice:
Public Class Form1
Public Declare Function OpenDrawerCD Lib
"winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal
lpstrReturnString As String, ByVal uReturnLength As Long, ByVal
hwndCallback As Long) As Long
'Abilita la funzione di apertura e
chiusura del cassetto CD
Private Sub Form1_Load(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OpenDrawerCD("set CDAudio door open", Nothing, 127, 0) 'Apre
End Sub
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenDrawerCD("set CDAudio door closed", Nothing, 127, 0)'Chiude
End Sub
End Class
.