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)
This was first published in August 2001