Results 1 to 5 of 5

Thread: ejecting cd-rom

  1. #1

    Thread Starter
    Member bcx7's Avatar
    Join Date
    May 1999
    Location
    Adelaide, South Australia, Australia
    Posts
    46

    Angry

    i want the code to eject a cd rom and then code to make the tray go back in to the computer.

    thanks
    I Use Visual Basic 5.0 Enterprise Edition SP3

  2. #2
    Guest
    Make a Form with 2 CommandButtons. Call them cmdOpen and cmdClose.

    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
    
    Private Sub cmdOpen_Click()
    
        ' Open the CD Drive
        mciSendString "set CDAudio door open", t, 127, 0
    
    End Sub
    
    Private Sub cmdClose_Click()
    
        ' Close the CD Drive
        mciSendString "set CDAudio door closed", t, 127, 0
        
    End Sub

  3. #3

    Thread Starter
    Member bcx7's Avatar
    Join Date
    May 1999
    Location
    Adelaide, South Australia, Australia
    Posts
    46

    two cd-roms?

    i got two cd-roms in my computer. how can i get it to eject the other one? (it only eject the d
    I Use Visual Basic 5.0 Enterprise Edition SP3

  4. #4
    New Member
    Join Date
    Nov 2000
    Posts
    3

    Re: two cd-roms?


    I have the same problem have you found a code sample ??



    Infojens

  5. #5
    Member
    Join Date
    Aug 2000
    Location
    Chennai , India
    Posts
    44
    Can someone post some code on how to check if the CD tray is open or closed.
    Rabin
    Windows : Visual Basic 6 Enterprise / 3.0 (16-bit)
    DOS : QBasic 4.5 , Visual Basic For DOS
    Web : HTML , VBScript , PHP (Learning)

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