?
Solved

How to define mask in ShellListView

Posted on 2003-03-20
3
Medium Priority
?
2,367 Views
Last Modified: 2012-05-05
Delphi 6 & 7 have beautiful component "ShellListView" located on "Samples" and one thing is missing; mask (or filter).

Question is:
How to define mask for "NonFolder" Object Type?
Example:
In ShellListView I would like to see only *.txt files.

Thx
Prozor7
0
Comment
Question by:prozor7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
mocarts earned 200 total points
ID: 8176765
OnAddFolder triggers on all objects added to listview. so you can use it:

uses Masks;

procedure TForm1.ShellListView1AddFolder(Sender: TObject;
  AFolder: TShellFolder; var CanAdd: Boolean);
begin
  // remove AFolder.IsFolder if you don't want to see folders too
  CanAdd := AFolder.IsFolder or MatchesMask(AFolder.PathName, '*.txt');
end;

wbr, mo.
0
 
LVL 9

Expert Comment

by:mocarts
ID: 8176808
btw source code for ShellCtrls is located under Demos\ShellControls directory
wbr, mo.
0
 

Author Comment

by:prozor7
ID: 8177389
What to say?
Fast and efficient, I will never find without your help!

Many thanks
Point are yours

I'm surprised that wasn't included in Object Properties.


Prozor7
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question