ShellBrowser Delphi Edition Documentation
ContentsIndexHome
PreviousUpNext
TShellBrowser Class

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.

TShellBrowser
Syntax
Pascal
TShellBrowser = class(TComponent);

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;
 
Name 
Description 
 
Creates an instance of a ShellBrowser component.  
 
Destroys the instance of a ShellBrowser component.  
 
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. 
 
FolderIdList contains a pointer to the ItemIdList of the current folder.  
 
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.  
 
ObjectName contains the name of the current 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.  
 
Allows you deal with non file system objects.  
 
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  
 
Compares the current object to another, specified by it ItemIdList relative to the current folder.  
 
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 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.  
 
Use GetThumbnailBitmap to get a TBitmap Thumbnail of the current file  
 
Use GetThumnailImage to get a TImage of a thumbnail.  
 
Wrapper for IShellFolder.GetUIObjectOf method.  
 
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 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.  
 
Find out if the current object is a shortcut to a folder  
 
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.  
 
Use SaveThumbnailToJPEG to save a thumbnail image as jpeg-file.  
 
Use SelectParent to select the parent folder.  
 
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.  
 
Name 
Description 
 
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.  
 
Use MultiObjects if you want use ShowContextMenu or InvokeContextMenuCommand for multiple files and folders.  
 
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.  
 
This event occurs when the user selected 'Rename' in the context menu of an object.  
 
Decides if the shell context menu is added above or below the supplied Delphi TPopupMenu.  
 
Use this property to define, if Windows error messages will be shown to the user or not.  
 
Allows you to deal with non file system folders.  
 
This is Version, a member of class TShellBrowser. 
 
Allows to set a callback function that can supply a thumbnail image in case the system cannot provide one.  
Copyright (c) 2011. All rights reserved.