Click here to Skip to main content
13,400,969 members (41,167 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Actually I want the indexing to work for some custom file types. For some custom file formats, I need to implement a filter or property handler to have file content and properties indexed . I googled it to get some samples relating to it but I could not find anything useful. Although I got an article from msdn which talks about extending the indexes for windows.[^]
Posted 20-Apr-11 22:24pm
Updated 20-Apr-11 22:32pm
BobJanova 21-Apr-11 4:14am
Good question.
Manfred R. Bihy 21-Apr-11 15:55pm
Indeed an interesting question! 5+
boyhamilton 5-Oct-11 8:36am
Did you make any progress on this? It would be great to use the indexing for my own purposes.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Also interesting question for me. This is surely not the optimal solution (in case I'm understanding it correctly), maybe something like a workaround or help with research.

I've read your link and especially the IFilter interface and ISearchCatalogManager are good points to give a try to test it.[^]

I first tried it the manually way, so I've added a custom file type in Windows Registry \HKEY_CLASSES_ROOT\ , I've taken .tkz for example. You can see some sample settings in .txt file which contains Properties like this:

\HKEY_CLASSES_ROOT\.txt contains string (Standard)/(Default) with value txtfile,Content Type (text/plain) and perceived Type(text)

\HKEY_CLASSES_ROOT\.txt\OpenWithList -- to open .txt with named links (in my case Dreamweaver is linked there as string)

\HKEY_CLASSES_ROOT\.txt\OpenWithProgIds -- also "alternative" applications to open with (will be displayed in context menue when selecting a txt-file to open "Open with..."). In my case there are values from Visual Studio and Open Office.

\HEKY_CLASSES_ROOT\.txt\PersistandHandler --> Important because it holds the CLSID that represents a COM class and also a file name extension.[^]

\HEKY_CLASSES_ROOT\.txt\ShellNew -- not so important for our case.

okay, so I've created a custom extension, then I've quickly used Windows search and searched for my extension *.tkz. After searching for it I had a look into
Windows indexing options (run control.exe srchadmin.dll) and my custom file was successfully indexed in Advanced->File Types.

It's a bit dirty, but it would be an easy task to insert a new extension in registry with strings and values and doing a short search with windows after this. I've don't tried it yet to do this programmatically.

A second point I got interested to test is trying to use the Index-Management-Interfaces with method AddCatalog(). Maybe it would be doing our above step to search after our custom file above needless.[^]

Hope it drives forward your researching in any way.

With Best Regards
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You should not be doing this.
Not because I say so, but because Microsoft does enter link description here.

Important In Windows 7 and later, filters written in managed code are explicitly blocked. Filters MUST be written in native code due to potential CLR versioning issues with the process that multiple add-ins run in.

If you decide not to use Windows 7, you can still use one of the implementation frameworks like iFilterCode to make one. But it will have to go through Interop all the time which is a pretty decent hit in speed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180218.2 | Last Updated 8 Jan 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100