Open/close CD-ROM drive

Hello, experts!
How can I open/close CD-Rom drive from within my application?
Thank you.
Who is Participating?
DefTonesConnect With a Mentor Commented:

      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

       Call mciSendString("Set cdaudio door open wait", vbNull, 0, Handle)

      Call mciSendString("Set cdaudio door closed wait", vbNull, 0, Handle)

happy trails

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.