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

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

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.  

procedure TForm1.DiskScannerScanDone(Sender: TObject; TotalFiles: Integer; TotalSize: Extended; ElapsedTimeInSeconds: Integer);  
  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.');  

See also
OnFileFound, OnScanFolder events;  
Execute, Stop methods.