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 1 / 5)

How can I prevent a file from being opened in the TJamShellList?

Assign the OnKeyDown event with this content:
if Key = vk_Return then Key := 0;

To prevent the automatic handling of a double click, simply add an OnDblClick event handler. Or, you can use the OnBeforeShellCommand event and use the AllowExecute parameter to prevent the execution. The Command parameter when opening a file will be "default" or "open".

I get a memory leak report that an instance of TComboBoxExEnumerator is not freed. Can this be avoided?

This problem applies to Windows XP only and is fixed in Windows Vista and later. It is documented in MSDN. With the current implementation of TComboBoxEx in the VCL this unfortunately cannot be avoided.

How can I show XYZ as a thumbnail?

The thumbnails are generated through the same Windows API function that the Windows Explorer uses, and so the ShellBrowser components will show similar thumbnails like the Windows Explorer. To provide thumbnails for a certain file format that Windows does not support out of the box, it is best to register a thumbnail provider in the system.

Another option is to use the OnThumbnailUpdated event of the TJamShellList control, which allows you to change the generated thumbnail.

TShellBrowser.SetThumbnailProvider()
allows you to set one application-wide thumbnail provider that is called if the system does not supply one.

How can I select the columns that are (initially) displayed in the TJamShellList?

Each Windows Shell extension may define which columns will be displayed for its view.To add or remove specific columns, use the OnCreateColumns event in combination with SetColumnVisibility. 

Example:
uses ShellBrowser; procedure TForm1.JamShellListCreateColumns(Sender: TObject);
begin 
   with JamShellList do
   begin
       SetColumnVisibility(TShellColumns.Size, False);
       SetColumnVisibility(TShellColumns.Author, True);
    end;
end;

Does the ShellBrowser Delphi Edition contain a control to preview files?

Yes, it contains the TJamFilePreview control.

How can I order ShellBrowser Delphi Edition and how will it be delivered?

You may order online at www.jam-software.comFor further questions, please have a look at the Shop FAQ:
www.jam-software.de/knowledgebase/customers/

Which operating systems are supported?

All current versions of Windows are supported. See here for further information.

 

Which IDEs are supported?

ShellBrowser is compatible with all current RAD Studio versions. See here for further information.

How can I forbid entering a specific folder in a JamShellTree and JamShellList?

You can use the TJamShellTree.OnChanging event like this:
uses ShellBrowser;
const
    forbiddenPath: String = 'C:\Windows';
procedure TMainForm.ShellTreeChanging(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean);
var
    shellNode: TJamShellTreeNode;
begin
    shellNode := node as TJamShellTreeNode;
    if (ShellBrowser.SamePath(shellNode.FullPath, forbiddenPath)) then
        AllowChange := false;
end; 
To achieve the same result in the JamShellList, use the TJamShellList.PathChanged event:
uses ShellBrowser;private
    lastPath: String;
const
    forbiddenPath: String = 'C:\Windows';procedure TMainForm.ShellListPathChanged(Sender: TObject);
begin
    if (ShellBrowser.SamePath(ShellList.Path, forbiddenPath)) then
        ShellList.Path := lastPath
    else
        lastPath := ShellList.Path;
end;

You can also use the OnBeforeShellCommand event and use the AllowExecute parameter to prevent the execution. The Command parameter when opening a folder might be "default" or "open".

When I move to certain folders (e.g C:\Windows\assembly) Delphi displays an error message like: "Could not get IShellFolder2 interface for current folder". How can I prevent this?

This message is triggered by a handled excpetion. In the default configuration, RAD Studio stops on all exceptions, if handled or not. The end-user will not see errors like this for handled excpetions. Using exceptions for error handling is common in modern programming languages.
We recommend turning off this option:
"Tools > Options > Debugger Options > Language Exceptions > Notify on Language Exceptions".

I can drag files from JamExplorer to the Windows Explorer, but not the other way round. What is going wrong?

Privileged processes do not receive Drag&Drop from non-privileged processes for security reasons. This could be the case if you start your IDE or your executable as admin.

How can I emulate the "One-Click" behaviour of the Windows Explorer in the TJamShellList?

1. Set the HotTrack property to True
2. Set the values htHandPoint and htUnderLineCold in the HotTrackStyles also to True.
3. Enter the following line to the OnMouseUp event of the JamShellList: JamShellList.InvokeCommandOnSelected('default');