?
Solved

How to define mask in ShellListView

Posted on 2003-03-20
3
Medium Priority
?
2,443 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
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

609 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