Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows .NET
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 20-Apr-11 22:24pm
Edited 20-Apr-11 22:32pm
v2
Comments
BobJanova at 21-Apr-11 4:14am
   
Good question.
Manfred R. Bihy at 21-Apr-11 15:55pm
   
Indeed an interesting question! 5+
boyhamilton at 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
good
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.
 
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
  Permalink  
v3
Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 6,569
1 Sergey Alexandrovich Kryukov 6,168
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 8 Jan 2014
Copyright © CodeProject, 1999-2014
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