function DiskInDrive(const Drive: char): Boolean;stdcall;
var DrvNum: byte;
EMode: Word;
begin
result := false;
DrvNum := ord(Drive);
if DrvNum >= ord('a') then
dec(DrvNum,$20);
EMode := SetErrorMode(SEM_FAILCRITICALERRORS);
try
if DiskSize(DrvNum-$40) <> -1 then
result := true
else
messagebeep(0);
finally
SetErrorMode(EMode);
end;
end;
Function DiskIsCDROMChar;
var Drivechar;
i:char;
begin
for i:='A' to 'Z' do
begin
drive:=Pchar(i+':/');
if GetDriveType(Drive)=DRIVE_CDROM then
begin
Result:=drive;
break;
end
else
Result:='0';
end;
end;