How to recognize drive types
If you're using VB4 32 bit, you can use the GetLogicalDrives API to get a 32-bit bitmask of all valid drive letters. FOr example, bit 0 is drive A. If it's a 1, then there is drive A in the system. Then use GetDriveType(""A:"") and check the return. if the drive is a CD-ROM, you will get a return of DRIVE_CDROM.
Author: Simon BernsteinDim dwDrives As Long Dim i As Integer Dim Mask As Long dwDrives = GetLogicalDrives() Mask = 1 For i = 0 To 26 If (dwDrives And Mask) Then If (GetDriveType(Chr(65 + i) & "":"") = DRIVE_CDROM) Then ' This drive is a CD-ROM End If End If Mask = Mask * 2 Next i |
||
Editor: Simon Bernstein Last update: 2024-10-06 Copyright 1995-2024 VBI |