'**************************' Controls the opening of the CD-ROM drive, Guan BY: Free Pentium (WGSCD) '******* ******************** Imports Microsoft.VisualBasic.comPatibility
Private Declare Function CDdoor Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer Private Sub Command1_Click (ByVal eventSender As System.Object, ByVal eventArgs As system.eventargs) Handles Command1.click
'If turned off, then the button is made to change if cdopen = false kil cddoor ("set cdaudio door open", 0, 0, 0) cdopen = true command1.text = "Click to close the CDD" Else' Otherwise close Call Cddoor ("SET CDAUDIO DOOR CLOSED", 0, 0, 0) cdopen = false Command1.text = "Click to open the CD drive" end if
End Sub 'WGSCD 2004-11-1' The syntax referenced is' Call CDDoor ("Set CDAudio Door Closed", 0, 0, 0) 'to close the light-drive gate' Call Cddoor ("Set CDAudio Door Open", 0, 0, 0) 'to open the light-drive gate DIM CDOPEN AS BOOLEAN
Private Sub Form1_Load (Byval Sender As System.Object, Byval E AS System.EventArgs) Handles mybase.load cdopen = false End Sub