Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
drv_type : Integer;
drive : Char;
t :
String;
begin
drive := Char(DriveComboBox1.Drive);
drv_type := GetDriveType(PChar(drive+'
:\'));
Case drv_type
of
DRIVE_UNKNOWN: t := '
Unknown';
DRIVE_REMOVABLE: t := '
Removable';
DRIVE_FIXED: t := '
Fixed';
DRIVE_REMOTE: t := '
Network';
DRIVE_CDROM: t := '
CD-ROM';
DRIVE_RAMDISK: t := '
RAM Disk';
end;
Label1.Caption := t;
end;
Und immer die Konstanten aus der Windows.pas nehmen. Die Werte, die du genommen hats, waren nämlich falsch.