diskscanner OnScanDone event
Return to Introduction  Previous page  Next page
Applies to
dcDiskScanner and dcMultiDiskScanner components.  

Declaration
type  
  TdcScanDoneEvent = procedure(Sender: TObject;  
    TotalFiles: Ingeger; TotalSize: Extended;  
    ElapsedTimeInSeconds: Integer) of object;  
 
property OnScanDone: TdcScanDoneEvent;  

Description
The OnScanDone event occurs once the dcDiskScanner component completes the scanning process in the location specified by Folder property and within all subfolders under specified folder (if IncludeSubfolders property is True). Use this event handler to get the total number of found files (TotalFiles parameter), their total size (TotalSize parameter, use FloatToStr function to convert this value to string), + time that passes after starting of the disk scanning (ElapsedTimeInSeconds — time that passes after calling the Execute method).  
 
The OnScanDone also occurs after calling of the Stop method, to return the total number of found files and their total size.  

Example
procedure TForm1.DiskScannerScanDone(Sender: TObject; TotalFiles: Integer; TotalSize: Extended; ElapsedTimeInSeconds: Integer);  
begin  
  ShowMessage('Scanning done.'#13#10 +  
              'Total files found by specified criteria: ' + IntToStr(TotalFiles) + #13#10 +  
              'Total size of files: ' + FloatToStr(TotalSize) + ' bytes'#13#10 +  
              'Elapsed Time: ' + IntToStr(ElapsedTimeInSeconds) + ' seconds.');  
end;  

See also
OnFileFound, OnScanFolder events;  
Execute, Stop methods.  
File not found.