Knowledgebase

status_loader

Not handling zip files as folders

Question / Problem

If I use the TJamShellList with a certain file filter, .zip files are being displayed as well, although the .zip extension is not a part of the filter. Is that a bug?

Answer / Solution

No actually it's not, since zip archives can be enumerated as well - the filter will be applied to the contents of the zip file.

If you want to change this, you can either:

  • Set the "FileSystemOnly" property of the ShellList to true
  • Implement the "OnAddItem" event and exclude zip files:

procedure TMainForm.ShellListAddItem(Item: TJamShellListItem;
  var CanAdd: Boolean);
begin
  if (Item.IsFolder and Item.AbsoluteItemIdList.HasAttributes(SFGAO_STREAM)) then
    CanAdd := false;
end;

Need further help getting started?

You did not find what you were looking for? Please contact us so we can provide an answer to your question.

Contact Form