Results 1 to 2 of 2

Thread: CD-Rom Drive

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Location
    Ocotlan, Jalisco, Mexico
    Posts
    18
    is there a way to know when a cd is in the drive, at the same time it is recognized by the system?

  2. #2
    Guest
    Put this in a Timer:

    Code:
    Function DetectCD() As Boolean
    On Error GoTo ErrHan
      Dir "D:\", vbDirectory
      DetectCD = True
    Exit Function
    
    ErrHan:
      DetectCD = False
    
    End Function
    
    Private Sub Timer1_Timer()
    If DetectCD() Then
    MsgBox "There is a CD in Drive D!"
    Timer1.Enabled = False
    Exit Sub
    Else
    'No CD
    End If
    End Sub

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