Open/Close CD-ROM Door

Declare

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
Sample Code
Sub OpenCDDoor()
  mciSendString "Set CDAudio Door Open Wait", 0&, 0&, 0&
End Sub
Sub CloseCDDoor()
  mciSendString "Set CDAudio Door Closed Wait", 0&, 0&, 0&
End Sub

 

Tip Submitted By: Malcolm Hubert


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.