I’ve spoken about the work I was doing with Windows Desktop Search (WDS) and Visual FoxPro before on this blog here and here. Though the project I present in this blog entry began when WDS 2.0 was the latest and greatest, it was rewritten for WDS 3.0 and has been revamped some and tested with WDS 4.0 (the latest and greatest as of this writing). In any event, this project was being considered by Microsoft (MS) for inclusion as part of Sedna, but never made the cut. I later obtained permission from MS to release it on my own, but haven’t found time to test it or post it until now.
Foxy Search Value
There are many things of value in the Foxy Search sample…
- Shows how to properly use the WDS OLEDB Provider from VFP.
- Provides a guide to the proper SQL syntax for WDS.
- Includes a list of fields available via the OLEDB Provider. (see fields.dbf)
- Provides VFP develpers a class for working with WDS and ultimately returning search results as VFP cursors.
If nothing else, Foxy Search provides a pretty good sample for messing with when trying out various aspects of WDS. It does not provide examples of the creation or use of IFilters, handlers, or thumbnail extractors – if you are looking for those you’ll have to look elsewhere at the moment.
Foxy Search Errors
It should be noted that Foxy Search can, and will, throw errors depending on the combinations of display fields, filters, and/or sorting chosen. Rather than attempt to restrict what can and can’t be chosen to lessen the errors, I felt it was easier to just allow the developer using it to mess around with everything and see what is and what isn’t possible. Feel free to change the Throw Error in the Catch of the form’s GetSearchResults method to handle the various errors you run into if you feel like it (or just comment it out if you want it to fail silently).
Don’t Have Windows Desktop Search?
You can check whether you have Windows Desktop Search and what version of it is on your system by looking in the Control Panel’s Add & Remove Programs or by looking in your registry under the “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Desktop Search” key where there is a “Version” value. If you don’t have WDS (or you are running an outdated version) you can go to the MS site to download and install WDS v4.0.
Until next time… Visual FoxPro Rocks!
Figure 1: Shows Foxy Search being used to find all of the FOXUSER files on my system and display information about each result.