stolksdorf
stolksdorf

Reputation:

Adding specific files or folders to a windows explorer view

I've been working on a tagging program for my computer. I need to the ability to pass a list of files or folders into an explorer (or something similar) to display them and be able to manipulate them much like you would do with a folder view in Windows.

I've already written the software which records and stores tags relative to file's path on the computer, and I can search through them dynamically creating a list of paths, but the next part I'm a little stumped on.

Even if there is a solution where I fool the operating into thinking the files are within a "temp" folder and simply display that, that would be perfect.

I'm written everything in C# so far, but I am not picky on the language.

Thanks in advance!

Upvotes: 3

Views: 1656

Answers (4)

Jewel S
Jewel S

Reputation:

Do a search for IShellFolder and IShellView. for example: http://www.codeproject.com/KB/shell/explorer.aspx

The interfaces are not especially simple to use, but not especially difficult either and they're quite powerful. from your description it sounds exactly like what you need to essentially host explorer's view within your app, point it at both the real filesystem and/or a custom namespace, and then customize/override the behavior.

Upvotes: 0

Keeron
Keeron

Reputation: 101

IExplorerBrowser control is the native interface for using the "Windows Explorer" control. This has been wrapped in a .NET way in Windows API Code Pack for .NET framework (http://code.msdn.microsoft.com/WindowsAPICodePack)

You could start by using that control (there is a WPF and winforms version, with events, collections you can bind to, tons of properties/flags to set, etc).

If that doesn't give you the desired control, you can move on to the actual Shell objects. The library above also provides access different types of Shell objects- files, folders, virtual items such as control panel, other known folders, etc. You can look at their Shell samples and see the usage.

In short, you can use a ListBox-like control in your app and display the types of files/folders (anything that is represented in Shell). You can also get rich information about each object, like their thumbnail/icon, properties, etc.

Upvotes: 2

codymanix
codymanix

Reputation: 29468

Sure you could create also temporary folders containing links to your tagged files and then embedding a explorer-control in your app which you could then let navigate to "file://c/temp/mytaggedfolder" or similar but..

What about simply add all data to a listView? There is lot of example code for that on codeproject for example.

Upvotes: 0

Mikhail Churbanov
Mikhail Churbanov

Reputation: 4500

Create your own directory viewer. However, it will be quite a challenging and time/money consuming task.

Variant 2:

Create catalog with all your tagged tree structure (use links to all real files or just some id-s).

Show it in explorer.

Track changes in that catalog and do following changes in with your tagged data.

Upvotes: 0

Related Questions