-
Hey
I want my cd-rom to open. I found this code but it doesn't work!
Option Explicit
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 cmdDoWhat_Click(Index As Integer)
Dim Ret As Long
Dim RetStr As String
Select Case Index
Case Is = 0: Ret = MCISendString("set CDAudio door open", RetStr, 127, 0)
Case Is = 1: Ret = MCISendString("set CDAudio door closed", RetStr, 127, 0)
End Select
End Sub
-
Code:
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 cmdClose_Click()
retvalue = mciSendString("set CDAudio door closed", _
returnstring, 127, 0)
End Sub
Private Sub cmdOpen_Click()
retvalue = mciSendString("set CDAudio door open", _
returnstring, 127, 0)
End Sub
-
Thanks