unit ShellListView1;
interface
uses
SysUtils, Classes, Controls, ComCtrls, ShellCtrls, ShellAPI;
type
TShellListView1 =
class(TShellListView)
private
FAutoExecuteFiles: Boolean;
protected
procedure DblClick;
override;
public
constructor Create(AOwner: TComponent);
override;
published
property AutoExecuteFiles: Boolean
read FAutoExecuteFiles
write FAutoExecuteFiles;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Eigene Komponenten', [TShellListView1]);
end;
{ TShellListView1 }
constructor TShellListView1.Create(AOwner: TComponent);
begin
inherited;
FAutoExecuteFiles := True;
end;
procedure TShellListView1.DblClick;
var
OldAutoNavigate: Boolean;
begin
OldAutoNavigate := AutoNavigate;
if Selected <>
nil then
AutoNavigate := AutoNavigate
and (Folders[Selected.
Index].IsFolder
or FAutoExecuteFiles);
inherited;
AutoNavigate := OldAutoNavigate;
end;
end.