ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellBrowser.TShellBrowser

The ShellBrowser component is a non-visual component and allows you to browse to the shell name space of Windows, to query information about shell objects and to perform context menu operations. It is currently only available in the VCL version and is the base for all visual controls.

ShellBrowser_TShellBrowserShellBrowser_TShellBrowser
Syntax
Pascal
TShellBrowser = class(TComponent, IShellCommandInvokable);

The ShellBrowser component is a non-visual component. The property Folder contains the path of the current folder, ObjectName contains the name of the current object. Use the method Next to enumerate the objects in the current folder. TShellBrowser.IconNumber contains the number of the corresponding icon of the current object in the system icon list. The method ShowContextMenu shows the context menu of the current object at a given point. You can shuffle your own popup menus together with the explorer context menu. InvokeContextMenuCommand will execute a command of the context menu, for example 'properties', 'default' or 'delete'. Use IsFolder to check if the current object is a folder. Use a TJamSystemImageList component to get the icons of files and folders.

This example shows how to get all drives of the current system.

ShellBrowser.SpecialFolder := SF_DRIVES; While ShellBrowser.Next do begin if Pos(':', ShellBrowser.ObjectName)>0 then ListOfDrives.Items.Add(ShellBrowser.ObjectName); end;

This example shows how to copy paths from one folder and paste them in another.

var lShellBrowser: TShellBrowser; begin lShellBrowser := TShellBrowser.Create(nil); lShellBrowser.Folder := 'C:Windows'; // path to copy from // Files to copy lShellBrowser.MultiObjects.Add('Explorer.exe'); lShellBrowser.MultiObjects.Add('Regedit.exe'); lShellBrowser.AsyncContextMenuOperations := false; // Make this synchronous, as we can paste only after copying is finished lShellBrowser.InvokeContextMenuCommand('Copy')); // Now paste Application.ProcessMessages; // This is important, context menu seems to recevie a message without that it doesn't work. lShellBrowser.FullPath := 'D:MyFolder'; lShellBrowser.InvokeContextMenuCommand('PASTE')); lShellbrowser.Free(); end;
ShellBrowser.TShellBrowser
 
Name 
Description 
 
This constructor creates a new instance of the TShellBrowser class and initializes for the given object identified by an ItemIdList. 
 
Destroys the instance of this class  
 
Name 
Description 
 
This event occurs, before a shell context menu command is executed.  
ShellBrowser.TShellBrowser
 
Name 
Description 
 
This event occurs, before a context menu command is executed.  
 
This event occurs, if the user has selected a menu item of the shell context menu.  
 
Name 
Description 
 
Getter for the OnBeforeShellCommand property.  
 
Setter for the OnBeforeShellCommand property.  
ShellBrowser.TShellBrowser
 
Name 
Description 
 
Adds a link (shortcut) to the element referred to by AbsoluteItemIdList in the passed folder. 
 
Use BrowseObject to browse into the current object.  
 
Returns true, if the current object can be renamed.  
 
Checks if the current object is in a valid state for performing operations  
 
Adds the current object(s) of this instance to a TJamShellChangeNotifier.  
 
Checks if the currently active object matches the filter.  
 
Get Attributes of the current object.  
 
Returns information about alignment and width of a column.  
 
Returns the text which would be displayed in the Details view of the Windows Explorer.  
 
Returns the value which would be displayed in the Details view of the Windows Explorer as Variant.  
 
Returns the default column state.  
 
Use GetDesktopIconIndex to get the number of the desktop icon.  
 
This method returns the language defendant name of the Desktop folder.  
 
This method returns the size of the current file in Bytes and -1 upon error.  
 
Returns the index for a given SHColumnId. 
 
This method returns the hint text of the current object, which is provided by the shell.  
 
Returns the last change date of the current object.  
 
Use GetOverlayIndex to get the index of the overlay icon of the current object.  
 
Returns the SHColumnId for a given column number. 
 
Gets the well formatted shell name of the current object.  
 
Returns the default sort column.  
 
Deprecated; Use instead.  
 
Deprecated; Use TJamThumbnailExtractor.GetThumbnailAsImage instead.  
 
Wrapper for IShellFolder.GetUIObjectOf() method which retrieves a COM object for current shell object(s).  
 
Handles messages of popup messages, neccessary to show Send To submenu correct.  
 
Use the property HasSubFolders to check if the current object has subfolders.  
 
Executes a command of the context menu of the current object.  
 
Executes a command of the context menu of the current object.  
 
Executes the default path on the given files. 
 
This function returns true, if the given path is a drive like C:, D: or \servershare .  
 
This function returns true, if the current object is a folder of the file system.  
 
Use the property IsFolder to check if the current object is a folder.  
 
Use this property to determine if the current object should be displayed as hidden.  
 
Use this property to determine if the current object is a shortcut to another object.  
 
Returns the type of the current object.  
 
Next 
Next enumerates the objects in the current folder.  
 
Query the BackgroundMenu - needed to generate the ShellNew-registry value for our NewFile-menu.  
 
Use RenameObject to rename the current object.  
 
Deprecated; Use TJamThumbnailExtractor.SaveThumbnailToJPEG instead.  
 
Use SelectParent to select the parent folder.  
 
Deprecated; Use TJamThumbnailExtractor.SetThumbnailProvider instead.  
 
Show the context menu when the user right clicks on the background of the Windows Explorer.  
 
Shows the context menu for files or folders as submenu of an existing menu item. 
 
Use this method to display the system dialog to connect a new network drive.  
 
Determines if the object represented by this instances is visible with respect to the TJamShellShowOptions that are passed.  
ShellBrowser.TShellBrowser
 
Name 
Description 
 
AbsoluteItemIdList returns a pointer to a fully qualified ItemIdList of the current object.  
 
If set to True (the default value), context menu operations will be executed asynchronously in an own thread if possible, if False, they will be executed synchronously in the main thread. 
 
Use FileSystemOnly to specify, if Next will return only file system objects.  
 
Allows you to filter objects by filename when enumerating them using the Next function.  
 
Folder contains the path to the current object.  
 
Gets or sets the current folder.  
 
Decides if additional levels shoule be enumerated that are useful for navvigational purposes.  
 
The full path of the current object. 
 
Use IconNumber to get the number of the icon for the current object.  
 
ItemIdList contains a pointer to the ItemIdList of the current object.  
 
Use MultiObjects if you want use ShowContextMenu or InvokeContextMenuCommand for multiple files and folders.  
 
ObjectName contains the name of the current object  
 
This event occurs when the user selected 'Rename' in the context menu of an object.  
 
If set to true, context menu operations that make changes to the file system (like "delete" or "copy") will not be executed.  
 
Use SelectedIconNumber to get the number of the 'opened' icon for the current object.  
 
This property gives access to the IShellFolder interface of the current folder.  
 
Decides if the shell context menu is added above or below the supplied Delphi TPopupMenu.  
 
Use this property to define, if Windows error messages and login dialogs will be shown to the user or not.  
 
Allows you to deal with non file system folders.  
 
Allows you deal with non file system objects.  
 
The version number of the ShellBrowser controls.