ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellControls.TJamShellList.OnBeforeCommand

This event occurs, before a context menu command is executed. This event is deprecated and will be removed. Use OnBeforeCommand instead.

Syntax
Pascal
property OnBeforeCommand: TOnBeforeCommand;

This event is triggered if a command from the context menu should be executed. It was either chosen from the shell context menu or triggered by a keyboard event.

//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;