Function GetCDList : String;
Var
I : Integer;
Drives: Integer;
Tmp : String;
begin
Drives := GetLogicalDrives;
Result := '';
// units A=0 to el Z=25
For I := 0 To 25 Do
If (((1 Shl I) And Drives)<>0) Then
Begin
Tmp := Char(65+I)+':\';
If (GetDriveType(PChar(Tmp))=DRIVE_CDROM) Then
Result := Result+Char(65+I);
End;
End; procedure TForm1.Button1Click(Sender: TObject);
begin
Showmessage(GetCDList);
end; |