ShellBrowser Delphi Components Documentation

The OnOperation event occurs after the TJamShellList executed a shell operation like pasting or dragging and dropping files.

property OnOperation;

Use the OnOperation event to get informed when the control performed a shell operation, for example a drag and drop operation or a Paste command. You may also consider to use the events OnAddItem, OnChange and OnDeletion instead.  

Operation gives you information about the type of operation that was performed. Files contains the file or folder names, that are affected. The filenames are provided with full path, to extract the name of the file, you can use the function ExtractFileName. See TJamShellOperations for a list of operations that may occur.  


The following example shows a message when files were dropped in the TJamShellList, indicating if the files were moved or copied and showing their filenames with full path. If a file has been renamed by the user inside the TJamShellList, a message with the old and the new filename is shown.

procedure TMainForm.ShellListViewOperation(Sender: TObject; Operation: TJamShellOperations; Files: TFilenames; Destination: Widestring);
var s: Widestring;
i: Integer;
if sopDrop in Operation then
if sopCopy in Operation then
s := 'The following files have been copied to ';
if sopMove in Operation then
s := 'The following files have been moved to ';
s := s + Destination+#10#13;//linefeed
for i:=0 to Files.Count-1 do
if sopRename in Operation then
s := 'File ' + Files[0] + ' has been renamed to ' + ExtractFileName(Destination);
if Length(s)>0 then ShowMessage(s);