i need the line code to open cd rom in vb
thank you !!!!!
Printable View
i need the line code to open cd rom in vb
thank you !!!!!
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
'Open it
retvalue = mcisendstring("set CDAudio door open", returnstring, 127, 0)
'Close it
retvalue = mcisendstring("set CDAudio door closed", returnstring, 127, 0)
you don't really need to pass the 3rd argument as 127. Leaving it blank will work as well.
Code:retVal = mciSendString("set CDAudio door open", returnstring, 0, 0)