Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
4.64/5 (12 votes)
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.
http://msdn.microsoft.com/en-us/library/bb318649%28VS.85%29.aspx[^]
Posted
Updated 20-Apr-11 21:32pm
v2
Comments
BobJanova 21-Apr-11 4:14am    
Good question.
Manfred Rudolf Bihy 21-Apr-11 15:55pm    
Indeed an interesting question! 5+
bretthamilton 5-Oct-11 8:36am    
Did you make any progress on this? It would be great to use the indexing for my own purposes.

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.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd940428%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/cc678933%28v=vs.85%29.aspx[^]

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.

http://msdn.microsoft.com/en-us/library/ms692491%28v=vs.85%29.aspx[^]

\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.

http://msdn.microsoft.com/en-us/library/windows/desktop/ee872086%28v=vs.85%29.aspx[^]

Hope it drives forward your researching in any way.

With Best Regards
Björn
 
Share this answer
 
v3
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900