Ver Mensaje Individual
  #4  
Antiguo 09-07-2007
Avatar de unreal4u
unreal4u unreal4u is offline
Miembro
 
Registrado: nov 2004
Ubicación: Temuco, Chile
Posts: 105
Reputación: 20
unreal4u Va por buen camino
Listo !!

Código Delphi [-]
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;

Tan cortito como eso era

SS:

Saludos !!
__________________
Código Delphi [-]
procedure Gracias; 
begin
 if Respuesta_a_Mensaje = TRUE then showmessage('Ojalá que te sirva')
 else showmessage('Gracias por responder... :-)');
end; // (c) unreal4u
Responder Con Cita