ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellControls.TJamShellList.ShowContextMenu

Show the context menu for the selected items.

Syntax
Pascal
function ShowContextMenu(const p: TPoint): String; override;
Parameters 
Description 
const p: TPoint 
The point where the context menu should be shown.  

The method returns the name of the command, which has been executed. For more information, see TShellBrowser.ShowContextMenu.  

 

Use this method to show the shell context menu for all selected objects. The context menu will be shown automatically if the ShellContextMenu property is true. p is the screen position, where the context menu should be displayed. You can use the PopupMenu property to append your own menu items to the shell context menu.  

 

This example will show the context menu for the selected items in a TJamShellList, after the user released the right mouse button:

procedure TMainForm.ShellListViewMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var Item : TListItem;
begin
if (Button!=mbRight) or (OtherCondition) then exit;
Item := List.GetItemAt(X,Y);
if not Assigned(Item) then exit;
ShellListView.ShowContextMenu(ShellListView.ClientToScreen(Point(X,Y)));
end;