shellproperties TdcShellProperties component
Properties Methods Events
Return to Introduction  Previous page  Next page
The TdcShellProperties component used to show the "Properties" dialog box or context menu for the shell objects (file, folder or disk).  

How to use ?
Just specify the name of shell object in the FileName property (this can be file, folder or even disk), and call ShowContextMenu method to display the context-menu from current mouse position, or ShowProperties to display the "Properties" dialog box.  
You can also perform the same operations without specifying the FileName property - just call the ShowContextMenuByFile and ShowPropertiesByFile methods and specify the name of shell objects as method parameter.  
new! The dcShellProperties component, of the DiskControls v3.0 and later, supports number advanced options which controls the behavior of the context menu. You can show or hide some groups of menu items in the context menu; allow or disallow operations assocated with menu items. See MenuOptions property and list of events for more details.  

Example 1 (following line shows the properties of "c:\autoexec.bat" file):
Example 2 (demostrates how to work with shell context menu)
procedure TForm1.ListView1MouseDown(Sender: TObject;  
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);  
  ListItem: TListItem;  
  if Button = mbRight then  
    ListItem := ListView1.GetItemAt(X, Y);  
    if ListItem <> nil then  
      ListItem.Selected := True;  
      with dcShellProperties1 do  
        if ListView1.ReadOnly then  
          MenuOptions := MenuOptions - [moCanRename]  
          MenuOptions := MenuOptions + [moCanRename];  
procedure TForm1.dcShellProperties1Rename(Sender: TObject;  
  FileName: String);  
  if ListView1.Selected <> nil then