by M. Akram (7 Submissions)
Category: Miscellaneous
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Wed 9th May 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)
A simple code to shut and close CD Door. Click Command1 door opens. Click Command2 Door shuts. Command3 ends the program
'Task: Open And Close CD Drives
Dim lngReturn As Long
Dim strReturn As Long
'To open the CD door, use this code:
lngReturn = mciSendString("set CDAudio door open", strReturn, 127, 0)
'Declarations
'Add 2 Command buttons and name them as you please.
End Sub
'Add This In A Module:
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
'Code:
Private Overloads Sub Command2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command2.Click
Dim lngReturn As Long
Dim strReturn As Long
Dim dblreturn
'To close the CD door, use this code:
dblreturn = mciSendString("set CDAudio door closed", strReturn, 127, 0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
No comments have been posted about A simple code to shut and close CD Door. Click Command1 door opens. Click Command2 Door shuts. Comm. Why not be the first to post a comment about A simple code to shut and close CD Door. Click Command1 door opens. Click Command2 Door shuts. Comm.