Home > How-To Library > System & API

How to open and close the CD ROM door once a command button is pressed

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
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 Private Sub Command1_Click() retvalue = mciSendString("set CD Audio door open", returnstring, 127, 0) End Sub Private Sub Command2_Click() retvalue = mciSendString("set CD Audio door closed", returnstring, 127, 0) End Sub

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.