Results 1 to 3 of 3

Thread: cd drive help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Question

    If i have 2 cd drives one is a burner, and one is a pos! how can i check to see which one has a cd in it, or what cd, or eject them and stuff like that?

  2. #2
    Guest
    To open and close the CD drive
    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", 0, 127, 0
    End Sub
    
    Private Sub cmdClose_Click()
        'Close the CD Drive
        mciSendString "set CDAudio door closed", 0, 127, 0
    End Sub

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Take a look at the platform SDK: Base Services->Hardware->Device Input and Output->Device Input and Output Reference->Device Input and Output Control Codes->IOCTL_STORAGE_CHECK_VERIFY.
    This is untested, but is a possibility to see if it has a CD loaded or not.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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