-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExisteDrives.pas
More file actions
27 lines (27 loc) · 879 Bytes
/
ExisteDrives.pas
File metadata and controls
27 lines (27 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Procedure ExisteDrives;
{Retorna todos os drives existentes na maquina. Esta procedure
exige um listbox}
var
DriveNum: Integer;
DriveChar: Char;
DriveBits: set of 0..25;
DriveType: TDriveType;
begin
Integer(DriveBits) := GetLogicalDrives;
for DriveNum := 0 to 25 do
begin
if not (DriveNum in DriveBits) then
begin
Continue;
end;
DriveChar := UpCase(Char(DriveNum + Ord('a')));
DriveType := TDriveType(GetDriveType(PChar(DriveChar +':\')));
case DriveType of
dtFloppy: ListBox1.Items.Add(DriveChar + ': Disco Flexível');
dtFixed: ListBox1.Items.Add(DriveChar + ': Disco Fixo');
dtNetwork: ListBox1.Items.Add(DriveChar + ': Network Volume');
dtCDROM: ListBox1.Items.Add(DriveChar + ': CD-ROM');
dtRAM: ListBox1.Items.Add(DriveChar + ': RAM');
end;
end;
end;