|
ShellBrowser Delphi Edition Documentation
|
Shows the context menu for files or folders.
The function returns the verb of the executed command (e.g. 'open', 'properties', 'delete') or the empty string if the user didn't select a command.
Use ShowContextMenu to show the context menu for the current object at position lppt. This is the absolute position on the windows screen. You can use the ClientToScreen method of Delphis VCL components to get the absolute coordinates. If M is not nil, the given Delphi popup menu will appear at the end of the explorer context menu. See InvokeContextMenuCommand for more information.
If you want to show the context menu for multiple objects, you must add the names of these objects to MultiObjects. ShowContextMenu will use the names provided in MultiObjects, if this list is not empty.
You can control if the shell context menu should be added above or below the supplied TPopupMenu using the property ShowContextMenuOnTop.
The following example will react on a right click of the user in a tree view. The full path of the folder is stored in the data property of the TTreeNode. If you are using Delphi 3, you should set the RightClickSelect property of your TTreeView to true.