By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
This code opens and closes the CDROM Driver with a button.
1. Create two buttons with the name "open" and "close" 2.Place this script under Declarations=>> 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 3.Place this script under the "click event of the "open" button=>> retvalue = mcisendstring("set CDAudio door open", _ returnstring, 127, 0) 4.Place this under the "click" event of the "close" button retvalue = mcisendstring("set CDAudio door closed", _ returnstring, 127, 0)