TcxCustomShellListView.OnExecuteItem Event
Occurs before the default associated program is launched for the file shell item activated by pressing the Enter key or by double-clicking the mouse.
Declaration
property OnExecuteItem: TcxShellExecuteItemEvent read; write;
Remarks
The APIDL
parameter identifies the shell item being activated by pressing the Enter key or by double-clicking the mouse. To convert the APIDL
parameter value to a readable string, use the GetPIDLName function.
Set the AHandled
parameter to True
, to prevent launching the default associated program for the activated file shell item.
The following code example demonstrates how to prohibit launching the default associated program for .BMP files.
procedure TForm1.cxShellListView1ExecuteItem(Sender: TObject;
APIDL: PItemIDList; var AHandled: Boolean);
begin
AHandled := Pos('.bmp', GetPIDLDisplayName(APIDL, True)) = Length(GetPIDLDisplayName(APIDL, True)) - 3;
end;
Note
The OnExecuteItem
event is fired only when the AutoExecute property is set to True
.
See Also