ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellBrowser.TJamSystemImageList.GetIndexFromPath

Returns the image index of a given path in the system image list.

Syntax
Pascal
class function GetIndexFromPath(const pFullPath: string; pSize: TJamImageListSize = si_Small; pOpened: Boolean = False): Integer;
Parameters 
Description 
const pFullPath: string 
The full path of the file or folder of which the image index should be retrieved.  
pSize: TJamImageListSize = si_Small 
The size of the image that should be retieved. Default: si_Small  
pOpened: Boolean = False 
Pass true¬†to receive¬†opened icons where available. Default false.  

Returns the index of the icon in the system image list, which should be displayed for the given file name.

This method returns the index of the icon in the system image list, which should be displayed for the given file name. You can use this index for example with the ImageIndex property of Delphi's TTreeNode and TListItem objects.  

The following examples will return the icon number for the hard disk icon and for a file provided in the Caption of a TListItem:  

 

index := SystemImageList.GetIndexFromPath('C:');
ListItem.ImageIndex := SystemImageList.GetIndexFromPath('C:DevelopmentJamExplorer.pas');