PDA

Click to See Complete Forum and Search --> : number of units


irk
May 20th, 2001, 03:58 AM
how can i know the number of units in a computer ( e.g. c:\,g:\, ecc)
using ONLY the api?

Vlatko
May 20th, 2001, 07:11 AM
Dim LDs As Long, Cnt As Long, sDrives As String
'get the available drives
LDs = GetLogicalDrives
sDrives = "Available drives:"
For Cnt = 0 To 25
If (LDs And 2 ^ Cnt) <> 0 Then
sDrives = sDrives + " " + Chr$(65 + Cnt)
End If
Next Cnt
form1.caption = sDrives

Vlatko
May 20th, 2001, 07:11 AM
You will also need this

Declare Function GetLogicalDrives Lib "kernel32" Alias "GetLogicalDrives" () As Long