Important alert: (current site time 6/18/2013 9:43:07 PM EDT)
 

winzip icon

ZipSearch 1.3.2 * Search File Names & Content in File System & Zip Files

Email
Submitted on: 6/11/2012 4:14:34 PM
By: Rde 
Level: Intermediate
User Rating: By 13 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 25768
author picture
 
     ZipSearch 1.3.2 * Search File Names & Content in File System & Zip Files

ZipSearch simulates the Windows search utility and extends on it to include zip file contents. Searches are based on name matching, and can also perform date and size filtering. Limited wildcard characters are supported for matching of folder and file names. Searches within file text supports multi-line, case-sensitive and case-insensitive matching, as well as whole-word-only searches. This tool can also perform searches within the text content of zipped files.

It can search within multiple locations simultaneously, and search to any sub-folder depth. Files and folders can be selected for exclusion from searches. Also, it catalogues all searched locations so subsequent searches are lightning fast.

This utility does not discard the results of the searches it performs, allowing the navigation of search results within the utility without losing the original list of results. Up to thirty searches can be performed before the oldest results are over-written by subsequent searches. More advanced search filtering can be achieved by merging the common items from the result of the multiple searches.

ZipSearch remembers all your settings. You can define groups of multiple paths for searching. The tree and list respond to the scroll wheel without the need to click on them first. File system monitoring updates ZipSearch as changes are made outside of the program. The interface remains responsive to user actions at all times, and allows access to search result items even as the search continues.

ZipSearch combines Shell change notification with the file system, removable media like CDs and DVDs, memory sticks, and USB drives to respond to all changes both in the search class and the GUI dynamically.

ZipSearch uses Info-Zip's Unzip32.dll to open zipped files for content searching and making zipped files available for display. Unzip32.dll is freely available at www.info-zip.org. ZipSearch also now uses Alexander Roshal's Unrar.dll freely available at www.rarlab.com.

Contributors: XP Styles thanks to Amer Tahir. Auto-complete thanks to Dan Redding. String comparison thanks to Ralph Eastwood. Thanks also to Norm Cook for inspiration from his brilliant ListView-FileListBox. Shell change notification module thanks to Louis - www.louis-coder.com.

Revision 1.3.2 - 10 June 2012 Updated the whole project to use the 'W' API functions to preserve unicode, however the zip and rar libraries may not support unicode file names internally.

If you are using an early Windows that does not support unicode then 1.3.1 is the last ANSI compatible version. Unless requested ANSI will no longer be supported.


Please find more information in the ZipSearch documents folder.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :ZipSearch 1.3.2 * Search File Names & Content in File System & Zip Files
'**************************************
' Quite a few API in 152k zip
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 52 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
7/17/2009 3:20:47 PMKenneth Foster

Just tried out your app. Works great. I like the in zipfile search feature. Always enjoy your code.
(If this comment was disrespectful, please report it.)

 
7/20/2009 4:35:07 AMRde

Hi Ken

Thanks for your kind words and globes, I'm glad you like it.

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
7/20/2009 4:37:43 AMRde

I made this for my own needes and wanted to search multiple locations and be able to exclude locations at the same time.

I modelled the GUI on the Windows Search utility, so it ended up a bit quirky with too much on one screen maybe.

I recommend using the keyboard (arrow keys and spacebar) to traverse the combo's.

It has limited drag n drop (drag off only, cannot drag onto it) but I don't plan to make this more like explorer.

Hope many of you all find this useful. I found myself using it even as I was still developing it, to search out API declares and constants in my collection of PSC zips!

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
7/25/2009 12:56:38 AMdreamvb

This is cool, much more better than the one in windows and faster, thanks for shareing 5*****
(If this comment was disrespectful, please report it.)

 
7/28/2009 10:15:25 AMRde

Hi dreamvb

Thanks for your comments and votes

Hope you find it useful

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
7/28/2009 6:54:00 PMACY

Fantastic Code and fast, it searched my 7100 zip files totalling 10 meg of data in 30 meg of disk space in just a few seconds, awesome.
Just one minor bug for small files (i.e. 5kb unzipped) in the Zip file appearing to be 0 in the code USize statement,
change this line
ElseIf (Not bFolder) And taPK_Hdr(mZFileCnt).USize Then
To this
ElseIf (Not bFolder) Then

5 Globes from me for your great program and thanks for sharing.
(If this comment was disrespectful, please report it.)

 
7/31/2009 11:04:47 AMRde

Hi ACY

Thanks heaps for your generous vote and especially for the feedback.

I will look into it asap. I think it may have something to do with using double data type?

I had errors when searching within files that are actually 0 bytes, so I added that to catch empty files.

I will update when I work out a fix.

Thanks again ACY and happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
7/31/2009 11:15:30 AMRde

I'm still working on this, improving the gui behavior mainly, fixed a couple of minor bugs.

Listview sorting wasn't seperating files and folders when ordered by date, and did a re-working of the compare function to fix it and gained some speed as well!

Will update with improvements soon - feedback most welcome.

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
8/9/2009 8:43:01 PMACY

Hi Rd.
Just a follow up on the
"taPK_Hdr(mZFileCnt).USize"
returning 0 problem, I tried your suggestion and created a new zip with the original small file and it returns the correct file size so I can only assume it's a different Zip format which incidentally was created by a Unix process so that is the only thing I can put it down too. Keep up the great work and thanks for sharing. :o-)
(If this comment was disrespectful, please report it.)

 
8/11/2009 2:35:56 AMRde

Requires Unzip32.dll version 5.52

Dated : Monday, 28 Feb 2005, 12:00 AM
Size : 206 KB (211,198 bytes)

It can be downloaded from the following FTP sites:

US - ftp://tug.ctan.org/tex-archive/tools/zip/info-zip/WIN32/unz552dN.zip

UK - ftp://ftp.tex.ac.uk/tex-archive/tools/zip/info-zip/WIN32/unz552dN.zip

Germany - ftp://ftp.dante.de/tex-archive/tools/zip/info-zip/WIN32/unz552dN.zip

(If this comment was disrespectful, please report it.)

 
11/1/2009 7:36:52 AMRde


Bug introduced in v1.1.7

In LoadCustomGroupNames:

Id = CLng(Right$(saItems(idx, 0), 1&)) ' "Group" & id

Should be changed to:

Id = CLng(Mid$(saItems(idx, 0), 6&)) ' "Group" & id

Will be included in next revision 1.1.9

(If this comment was disrespectful, please report it.)

 
12/22/2009 12:26:18 AMRde

Revision 1.2 updated 17 Dec (not Nov)
(If this comment was disrespectful, please report it.)

 
12/22/2009 12:17:16 PMBill K of Boston

fast and effective *****
(If this comment was disrespectful, please report it.)

 
12/24/2009 1:03:42 PMKenneth Foster

Rde, Still a great project. I was wandering, can certain folders be skipped during the search?
(If this comment was disrespectful, please report it.)

 
12/26/2009 1:37:51 AMRde

Hi Bill K

Thanks and happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
12/28/2009 11:58:12 PMRde

Answered Ken in email. The answer was yes!

Due to the lack of a Help file for this (yet) usage details can be found in the Readme.txt.

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
1/8/2010 11:05:04 AMAMIT MESHRAM

nice code rde
great work :)
can send me yur mail box address..?
if i had some coding problem then i will asked you by mails..
please
(If this comment was disrespectful, please report it.)

 
10/23/2010 4:02:22 AMDave Carter

Fabulous :D, thank you.
(If this comment was disrespectful, please report it.)

 
10/26/2010 9:48:34 AMRde

Thanks Dave :)
(If this comment was disrespectful, please report it.)

 
12/29/2011 2:59:53 PMBill K of Boston

faster version for sure
5byme
bill

(If this comment was disrespectful, please report it.)

 
1/8/2012 2:41:15 PMfancytom

This is very excellent good code.
If prsss [Deregister Path]
then a little bug in ZipSearch_Error.log
------------------------------------------
ZipSearch error log 3:29:53 am January 9, 2012
frmZipSearch.LoadRecentItems error!
Error # 91 - 沒有設定物件變數或 With 區塊變數
* * * * * * * * * * * * * * * * * * *
Private Sub LoadRecentItems(sSection As String)
...
...
sItem = saItems(idx, 0) '<== bug line
...
...
End Sub
(If this comment was disrespectful, please report it.)

 
1/8/2012 5:08:30 PMfancytom

"mReplaceApi.BAS" is GOOOOOOOOD Code !
Put it in my stock project ,I found that :

If variable Type is Variant
THEN "mReplaceApi.BAS" is not OK .

Please modify It ,thanks !

'- for example:------------------------------------
Dim x As Variant
x = Replace$(x, ",", "")
(If this comment was disrespectful, please report it.)

 
1/10/2012 4:33:56 AMRde

Hi fancytom, thanks for the feedback :)

I will fix the error and re-upload

As for the replace module,
there are two fixes

The easiest is to simply do this:

Dim x As Variant
x = Replace$(CStr(x), ",", "")

The other fix is harder.
In the replaceApi mod:

Change
Func Replace(sString As String, sTerm...
to
Func Replace(sStr, sTerm...

Then declare the string variable:

On Error GoTo FreakOut
Dim sString As String
sString = CStr(sStr)
etc...

Hope this helps.
Let me know if this does not fix it

Happy coding :)

(If this comment was disrespectful, please report it.)

 
1/12/2012 11:59:43 PMfancytom

Yes,It Is helpful ,thank you.
x = Replace$(CStr(x), ",", "")

You are a capable man.

it is my project picture. at:
http://myweb.hinet.net/home1/fancytom/Jpg20120113_122417.JPG
(If this comment was disrespectful, please report it.)

 
5/15/2012 7:51:49 PMZhu JinYong

Now WinZip has .Zip and new .Zipx.
(If this comment was disrespectful, please report it.)

 
5/16/2012 6:01:31 AMRde

Hi again all

Revision 1.2.9 is up - this project is very nearly complete now!

A request - remove any existing error log file in the ZipSearch folder, then in a week or two, look again and email me a copy if it is there again.

Your feedback is needed!

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
5/17/2012 1:55:54 AMRde

Hi Zhu JinYong

ZipSearch uses Info-Zip's Unzip32.dll to access zip files so will need Info-Zip to update the dll to .zipx

Happy coding,
Rd :)
(If this comment was disrespectful, please report it.)

 
5/25/2012 2:35:42 AMRde

ZipSearch now also uses Alexander Roshal's Unrar.dll to open RAR files for content searching and can make packed files available for display.

Unrar.dll is freely available from http://www.rarlab.com - Extras.

If you download version 3 of this DLL it will be named Unrar3.dll and so the declares in RarFiles.bas will need to be updated to "Unrar3".

If you have an earlier version of Unrar.dll it will work fine.

(If this comment was disrespectful, please report it.)

 
6/11/2012 11:25:48 PMRde

I'm not sure but you may need to change the fonts for all the controls that display text in ZipSearch from within the IDE before compiling if Unicode characters are not displaying correctly for you?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.