Click here to Skip to main content
15,915,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How I can eject cd, dvd-rom using VB.NET
Posted

After extensive googling (ten seconds) I found this...



The following code lets you open and close a cd rom drive

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 cmdOpenCD_Click()
Dim lRet As Long
    lRet = mciSendString("set CDAudio door open", returnstring, 127, 0)
End Sub
Private Sub cmdCloseCD_Click()
Dim lRet As Long
    lRet = mciSendString("set CDAudio door closed", returnstring, 127, 0)
End Sub


Hope it helps
 
Share this answer
 
 
Share this answer
 
Use following link will help you

Use This

regards
koolprasad2003 :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900