Segun el truco 351 de trucomania es asi:
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
function GetDirectorySize(const ADirectory: string): Integer;
var
Dir: TSearchRec;
Ret: integer;
Path: string;
begin
Result := 0;
Path := ExtractFilePath(ADirectory);
Ret := Sysutils.FindFirst(ADirectory, faAnyFile, Dir);
if Ret <> NO_ERROR then
exit;
try
while ret=NO_ERROR do
begin
inc(Result, Dir.Size);
if (Dir.Attr in [faDirectory]) and (Dir.Name[1] <> '.') then
Inc(Result, GetDirectorySize(Path + Dir.Name + '\*.*'));
Ret := Sysutils.FindNext(Dir);
end;
finally
Sysutils.FindClose(Dir);
end;
end;
begin
Caption:=IntToStr( GetDirectorySize('c:\delphi3') );
end;
Si lo asignas a Caption como esta en la funcion aprecera en la barra de titulo del formulario.
Nota: Por favor no vuelvas a repetir hilos.
espero te sirva
.