Knowledge Base

ShellBrowser Delphi Components



Hello and welcome to our Knowledge Base. Our experts provide answers to the most frequently asked questions of our customers. Start your information search here to find your answer quickly and easily.
Please enter your query or select one of the above categories.

All entries (Page 2 / 5)

How do I change the icon of a specific file type in the JamShellList?

If the new icon is also part of the system image list, then this can be easily achieved using the OnGetImageIndex event of the JamShellList. You can get the full name and path of a specific item in the list using the GetFullPath method.
To get the index of a specific file type icon, you can use the GetIndexFromExtension method of the TJamSystemImageList component.Since the system image list is a global resource that is shared among all applications it cannot be changed easily. To add your custom icon to this image list you must register a file extension (a dummy one if necessary) with your icon in the system. This is done via the registry. Have a look here on the respective keys and how to manipulate them in Delphi: http://forum.codecall.net/topic/69184-solved-file-association-and-the-registry/ Note: Many installation builders can register icons for a specific file extension, e.g. InnoSetup

How can I check if a file is currently in the clipboard?

Just use this line of code:
Clipboard.HasFormat(CF_HDROP);

How can I exclude a drive from the list?

You can use the OnAddItem event to exclude e.g. the floppy drive like this: CanAdd := not (GetDriveType(PChar(JamShellList.GetFullPath(Item))) in [DRIVE_REMOVABLE]); This will exclude the floppy drive. It is also possible to exclude other drives like the CD-ROM (DRIVE_CDROM).

How can I expand nodes like SF_FAVORITES or SF_LIBRARIES in the JamShellTree?

To expand these nodes, you may use code like this: procedure TMainForm.FormShow(Sender: TObject);
var
    i:Integer;
begin
    i := 0;
    while (i < ShellTree.Items.Count) do
    begin
        if (ShellTree.Items[i].AbsoluteItemIdList.SpecialFolder in [SF_FAVORITES, SF_LIBRARIES]) then
            ShellTree.Items[i].Expand(False);
        Inc(i);
    end;
end;

How can I exclude a drive from the JamShellTree?

You can use the OnAddFolder event with a statement like this:
CanAdd := not (GetDriveType(PChar(Path)) in [DRIVE_REMOVABLE]); This will exclude the floppy drive. It is also possible to exclude other drives like the CD-ROM (DRIVE_CDROM).

Why do the thumbnails have an ugly black background?

The thumbnail images show a black background if your application does not include a proper XP manifest. Windows then loads the old Windows 2000 version of ComCtl32.DLL which cannot deal properly with alpha channels.
To solve this please include the unit "XpMan" somewhere in your project or set "Project > Options > Application > Runtime Themes" to the value "Enable runtime themes".

How can I find out if an item in the TJamShellList is a directory?

You can use a statement like this:
ShellList.Selected.IsFolder;

How do I get the check status of an item?

TJamCheckableListItem.CheckState

How do I check all items of the currently selected path in a JamShellList?

use the following line: JamShellLink.SelectionList.Add(JamShellList.Path);

How do I reset all checkboxes to an unchecked state?

use the following command:JamShellLink.SelectionList.Clear();

How can I determine in a TJamShellList the full path of a file including its extension, if the user has turned off extensions in his Windows Explorer settings?

You can use TJamShellListItem.FullPath, or JamShellList.SelectedFiles, which will return a full file name that always includes the extension.

How can I prevent actions that are caused by key presses, e.g. a FullRefresh by F5?

Use the OnKeyDown event like this and overwrite the Key value:

procedure TForm1.MyistKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
   // suppress a FullRefresh by F5
   if (Key = VK_F5) then
      Key := 0;
end;