How do I open the cdrom? I mean ejecting it...
Printable View
How do I open the cdrom? I mean ejecting it...
Code:'in declarations
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
'to use
mciSendString "set CDAudio door open", 0&, 127&, 0& 'ejects
mciSendString "set CDAudio door closed", 0&, 127&, 0& 'shuts up
There are other ways but this is an easy one.
_______________________________________
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 CmdOPEN_Click()
retvalue = mciSendString("set CDAudio door open", _
returnstring, 127, 0)
lblSTATUS.Caption = "Cd Drive is Open"
End Sub
Private Sub CmdCLOSE_Click()
retvalue = mciSendString("set CDAudio door closed", _
returnstring, 127, 0)
lblSTATUS.Caption = "Cd Drive is Closed"
End Sub
_______________________________________
-Smell Ya Later
Great, thanx guyz...