procedure TForm1.Button2Click(Sender: TObject);
var drives : dword;
i : integer;
begin
drives := GetLogicalDrives;
for i := 0 to 25 do //ingilizce alfabede 25 harf var
if ( drives and ( 1 shl i )) > 0 then
Listbox1.Items.Add( Chr( i + 65 ));
end;
veya
procedure TForm1.Button1Click(Sender: TObject);
var buffer : array[0..500] of char;
temp : PChar;
typ : integer;
begin
GetLogicalDriveStrings( sizeof( buffer ), buffer );
temp := buffer;
while temp[0] <> #0 do
begin
typ := GetDriveType( temp );
with ListBox1.Items do
case typ of
DRIVE_REMOVABLE : Add( temp + ' removable' );
DRIVE_FIXED : Add( temp + ' Sabit Disk' );
DRIVE_REMOTE : Add( temp + ' Ag üzerinde' );
DRIVE_CDROM : Add( temp + ' CD-ROM' );
DRIVE_RAMDISK : Add( temp + ' RAM-disk' );
else
Add( temp + ' Bilinmiyor' );
end;
temp := StrEnd( temp ) + 1;
end;
end;