Shelltreeview Root › Technical support › Troubleshooting This topic has 6 replies, 2 voices, and was last updated 11 years, 8 months ago by Dennis445. Viewing 7 posts - 1 through 7 (of 7 total) Author Posts March 25, 2013 at 10:38 pm #35698 Dennis445Participant Hello Is there a method for filtering file in a shelltreeview for example only showing .exe or .ini? March 25, 2013 at 11:23 pm #50382 CheshireCatParticipant Hello, try this: Code: procedure TForm1.sButton1Click(Sender: TObject); begin sShellListView1.Mask := '*.exe;*.ini'; end; I hope you mean ShellListView instead ShellTreeView 🙂 March 25, 2013 at 11:32 pm #50383 Dennis445Participant Thanks for the reply however I do need it for shelltreeview. March 25, 2013 at 11:49 pm #50384 CheshireCatParticipant maybe it works with the method AddFolder … Code: procedure TForm1.sShellTreeView1AddFolder(Sender: TObject; AFolder: TacShellFolder; var CanAdd: Boolean); var Ext: string; const Mask = '.exe'; begin Ext := ExtractFileExt(AFolder.DisplayName(seSystem)); CanAdd := AFolder.IsFolder or (CompareText(Mask, Ext) = 0); end; March 26, 2013 at 12:49 am #50385 Dennis445Participant That works, thank you. I also want to add that with your code if I wanted to have multiple ext in the tree I extended the “or” Mask[0] := '.exe'; Mask[1] := '.ini'; CanAdd := AFolder.IsFolder or (CompareText(Mask[0], Ext) = 0) or (CompareText(Mask[1], Ext) = 0); is this the best way to have several file types show? March 26, 2013 at 11:21 am #50388 CheshireCatParticipant 'Dennis445' wrote: … is this the best way to have several file types show? I think this is the best way 🙂 March 26, 2013 at 1:25 pm #50389 Dennis445Participant Thank you, I very much appreciate the advice. Author Posts Viewing 7 posts - 1 through 7 (of 7 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In Root › Technical support › Troubleshooting