procedure ObtenerInfo;
var
drive : char;
pVolName : PChar;
pFSBuf : PChar;
SectPerCls,
BytesPerCls,
FreeCls,
TotCls : DWord;
begin
for drive := 'A' to 'Z' do
begin
if GetDriveType(PChar(drive + ':\')) in [DRIVE_CDROM] then
begin
GetMem(pVolName, MAX_PATH);
GetMem(pFSBuf, MAX_PATH);
GetVolumeInformation(PChar(drive + ':\'), pVolName, MAX_PATH, nil,
SectPerCls, BytesPerCls, pFSBuf, MAX_PATH);
GetDiskFreeSpace(PChar(drive + ':\'), SectPerCls, BytesPerCls, FreeCls, TotCls);
if FormatFloat('0.00', (SectPerCls * BytesPerCls * TotCls / 1000000)) = '0.00' then
Form1.ComboBox1.Items.Add('No hay CD o DVD en [' + drive + ':\]')
else
Form1.ComboBox1.Items.Add(PChar(pVolName) + ' - [' + drive + ':\]');
FreeMem(pVolName, MAX_PATH);
FreeMem(pFSBuf, MAX_PATH);
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ComboBox1.Clear;
ObtenerInfo;
ComboBox1.DroppedDown := TRUE;
end;