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]
Printable View
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]
Maybe enumerate them all, check if they're cd drives and then open/close the one you need?
Is that what you need?Code: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
No jop, actually i want to open the 2nd drive tray