ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellBrowser.TOnBeforeShellCommand

The event that is fired before a shell command is executed.

Syntax
Pascal
Parameters 
Description 
Sender 
The executing ShellBrowser. 
Command 
The command that is executed. TShellBrowser.InvokeContextMenuCommand for a list of commands. 
Items 
The affected Items. 
AllowExecute 
Set this to false if you don't want the command to be executed. 
//using the new BeforeCommand event
procedure TMainForm.ShellListBeforeCommand(Sender: TObject; var pCommandArgs:
    TBeforeCommandEventArgs);
begin
  //always open folder internally, instead of opening a File Explorer instance.
  if (pCommandArgs.Command = TShellAction.saOpen) and (pCommandArgs.CommandSource = TCommandSource.ContextMenu)
    and (pCommandArgs.Items.Count = 1) and (pCommandArgs.Items[0].IsFolder) then
  begin
    pCommandArgs.Cancel := true;
    ShellList.FolderIdList := pCommandArgs.Items[0];
  end;
end;