Results 1 to 2 of 2

Thread: How to Open an Close the CD-ROM Drive

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Wellington NZ
    Posts
    153

    Talking

    Hi there, are there any code wizards out there that can tell me how to open and close the CD-ROM drive?

    Rohan

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Dallas, TX
    Posts
    89

    CD-Rom Door Open/Close

    RohanWest,

    Hope this helps...


    Option Explicit

    Dim dooropen As Boolean

    Private Declare Function mciSendString Lib "winmm.dll" _
    Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
    pstrReturnString As String, ByVal uReturnLength As Long, ByVal _
    wndCallback As Long) As Long

    Private Sub cmdClose_Click()
    Dim lRet As Long
    Dim sRet As Long

    If dooropen Then
    lRet = mciSendString("set CDAudio door open", sRet, 127, 0)
    dooropen = False
    Else
    lRet = mciSendString("set CDAudio door closed", sRet, 127, 0)
    End If

    End Sub

    Private Sub cmdOpen_Click()
    Dim lRet As Long
    Dim sRet As Long

    If dooropen Then
    lRet = mciSendString("set CDAudio door closed", sRet, 127, 0)
    dooropen = True
    Else
    lRet = mciSendString("set CDAudio door open", sRet, 127, 0)
    End If

    End Sub
    ande211
    VB6 SP3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width