Click to See Complete Forum and Search --> : How to open a CD drive if there is more than one?
haisanthosh
Dec 16th, 2000, 08:23 PM
I have got 2 cd drives. There are so many posts here to open and close the drive tray, but it only works with my first drive(master). What should I do if i want to open my second drive tray?
[Edited by haisanthosh on 12-17-2000 at 09:44 PM]
Jop
Dec 17th, 2000, 06:26 AM
Maybe enumerate them all, check if they're cd drives and then open/close the one you need?
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Const DRV_Removable = 2
Const DRV_Fixed = 3
Const DRV_Remote = 4
Const DRV_CdDrive = 5
Const DRV_RAMDisk = 6
Private Function GetDrives()
Dim x%, d%
For x = vbKeyA To vbKeyZ
d = GetDriveType(Chr(x) & ":\")
Me.Print Chr(x) & " = " & d
If d = DRV_CdDrive Then MsgBox Chr(x) & " = CD"
Next x
End Function
Is that what you need?
haisanthosh
Dec 17th, 2000, 08:55 PM
No jop, actually i want to open the 2nd drive tray
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.