Sign in to follow this  
Followers 0
KJohn

neoSearch 1.86

261 posts in this topic

#1 ·  Posted (edited)

Posted Image

[neoSearch - Screenshots - Testimonials - Feedback] Ξ [Koshy John]

Release date: 01-01-2009, 00:00 IST (GMT +530) - version 1.86 (forward release)

Size: 470KB

Download count: 12,675+

Quick Feature List

- Super-fast indexing (options to include/exclude paths, schedule, set priority; progress display window)

- Six rapidly changing dynamic results that change as you type

- Full list of results (re-sortable by name, size, date, path)

- Super-Navigation - allows you to rapidly access any file or folder on your system using wildcards and path auto-completion.

- Unicode support - foreign language search!

USP

- It's fast! Ridiculously fast! And it's amazingly light on memory and processor usage (proc spikes only if indexing at maximum speed).

- It looks really really good. Vista-esque. Check out the screenshots.

- It does not require administrative privileges! Use it ANYWHERE!

Posted Image

Websites Hosting neoSearch

Posted Image Posted Image Posted Image Posted Image and many many more...

Edited by Koshy John

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Hmm, this is good. I dont know why you are not allowing the source to be released :whistle:

I have, unfortunately, come across a lot of people who've rampantly copied other ppl's work and changed stuff here and there and pass it off as their own. I'll probably release the source or portions of it when I'm done working on it. Pardon my paranoia till then.

If there are any feature betterments that you can suggest, that would be great.

Oh and it has a built-in uninstaller, so no worries there.

To get all the files you want indexed, you will have to change the included paths in the options window.

Performance Sample

On my Windows Vista laptop having 122,714 files across 7 partitions (including 8500 songs, 25 movies and around 50 documents, apart from the regular programs):

- default settings (only your desktop, start menu, documents folder, etc. as specified by windows are scanned)

Indexing: 4.5 seconds

Searches: 0.01 secs (max)

- everything's included in options and nothing's excluded.

Indexing: 3 minutes (long since every MP3 file is opened and ID3 tags scanned, similarly for documents and executables (like author, company, etc.)

Searches (dynamic results): 0.04 secs (usually)

Searches (all results): 0.17 secs (avg)

This was run on a system with the following config:

HP Pavilion dv9295ea

Core2Duo 2 Ghz

2GB DDR2 RAM

2x120GB 5400rpm (not RAID; bottleneck coz of lower rpm; it'll run faster on desktops)

Windows Vista Ultimate

Please note that

- it runs faster under XP on the same machine

- it'll run faster on systems with 7200 rpm or higher HDDs, especially if there are more files whose meta data has to be read by manually opening them

- it'll run faster on systems with faster processors if there are lesser files to be manually opened

Tip

You can find out the performance figures on you system by viewing the logs. Open up the options window and select logs.

Doubt

Is it possible to load an icon by updating a control where originally an image was loaded? just wondered coz the ctrl update function for the both are the same. it didn't work for me when i tried, but then i could have been overlooking something....

Edited by Koshy John

Share this post


Link to post
Share on other sites

Worked good, but after I wanted to Index all my Harddrives it gave me this error (90% complete and took quiet some time..damnit)

Posted Image

Share this post


Link to post
Share on other sites

Worked good, but after I wanted to Index all my Harddrives it gave me this error (90% complete and took quiet some time..damnit)

Posted Image

That error is caused in the section of the code where it tries to read the metadata of files. I haven't implemented it yet but I intend to let users to prevent neoSearch from scanning the metadata of files. It is caused when it is unable to create the object required to open the file.

Relevant code:

$oShellApp = ObjCreate("shell.application")
$oDir = $oShellApp.NameSpace ($fpath)
$oFile = $oDir.Parsename ($fname)

If you can figure out why it was not able to do so by estimating what file it might hav been trying to index when it reached 90% and testing around that point by including/excluding that path, it would be easier to troubleshoot. If you percieve its too much of a waste of time, please wait while I write a generic fix (maybe by day after tomorrow).

I'm a little busy right now with studies for examinations. I will definitely write a fix for this as soon as possible. Thank you for your report.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

For me a partition worth ~40gb (~30gb of those are mp3) with ~15k files took 4.5 mins to index. Which is ok, I guess.

Though the indexer totally choked on system partition for me, two times tried so far. Even if the logs showed that for whatever smart reason it decided to "heuristically" exclude pretty much whole lot of Program Files folders... that didn't seem to help it much :whistle: Got to 41% moderately fast (maybe because it was excluding like crazy) and stuck on it, just consuming CPU and updating the tooltip veery slowly (like 30 mins to get to 50%).

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

For me a partition worth ~40gb (~30gb of those are mp3) with ~15k files took 4.5 mins to index. Which is ok, I guess.

Though the indexer totally choked on system partition for me, two times tried so far. Even if the logs showed that for whatever smart reason it decided to "heuristically" exclude pretty much whole lot of Program Files... that didn't seem to help it much :whistle: Got to 41% moderately fast (maybe because it was excluding like crazy) and stuck on it, just consuming CPU and updating the tooltip veery slowly (like 30 mins to get to 50%).

Quick update: I'm removing the meta-data indexing portion for now. Download again to see if it works.

Heuristic exclusion of Program Files basically means that only executables from those folders are indexed. I did that to improve performance. I can remove it if you want but most ppl benefit from it being excluded.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Quick update: I'm removing the meta-data indexing portion for now. Download again to see if it works.

Heuristic exclusion of Program Files basically means that only executables from those folders are indexed. I did that to improve performance. I can remove it if you want but most ppl benefit from it being excluded.

Now without it that 40gb/15.000 files partition took 1:30 to index (although maybe it reused old index? although I uninstalled the old version).

But if meta-data indexing means user could search by metadata, such as song title, then it's a very cool feature to have, and I wouldn't mind longer indexing time. Maybe consider adding "Advanced options", where the user could tweak the engine - turn on/off some of such parameters, and that "heuristic" too (search that wouldn't return all files is imo contradictory to the definition of search as a term, not even talking about practical use here), etc.

For some reason now it managed the system partition too, BUT. It excluded most of "Program Files", as you say it does. It excluded whole system dir. Those two make for majority of files on the partition. Other files are just:

1.5gb in "Documents and Settings", Temp and a couple of programs installed to the root.

1.3gb pagefile and hybernate file.

0.8gb of small junk (23.000 files) in Recycler, and that's where the indexer spent majority of time, according to Filemon. Can't say I blame it, because windows explorer takes awhile when opening it too :whistle: (But quite frankly, excluding Recycled trash would make more sense than excluding data files in program files or system folder.)

Indexing time 5:40 min. :\

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

Now without it that 40gb/15.000 files partition took 1:30 to index (although maybe it reused old index? although I uninstalled the old version).

But if meta-data indexing means user could search by metadata, such as song title, then it's a very cool feature to have, and I wouldn't mind longer indexing time. Maybe consider adding "Advanced options", where the user could tweak the engine - turn on/off some of such parameters, and that "heuristic" too (search that wouldn't return all files is imo contradictory to the definition of search as a term, not even talking about practical use here), etc.

For some reason now it managed the system partition too, BUT. It excluded most of "Program Files", as you say it does. It excluded whole system dir. Those two make for majority of files on the partition. Other files are just:

1.5gb in "Documents and Settings", Temp and a couple of programs installed to the root.

1.3gb pagefile and hybernate file.

0.8gb of small junk (23.000 files) in Recycler, and that's where the indexer spent majority of time, according to Filemon. Can't say I blame it, because windows explorer takes awhile when opening it too :whistle: (But quite frankly, excluding Recycled trash would make more sense than excluding data files in program files or system folder.)

Indexing time 5:40 min. :\

I can't believe I spent more than a year on search programs and overlooked the recycle bin!

But then in my favour, I NEVER use the recycle bin. I don't know any power users that do. Its just one big copy operation before actually deleting it (if that's the idea).

You could really use DiskMax. Check the first post for link to thread.

I'll optimize the code soon. And as for why it took only 1:30 : That's coz metadata querying takes A LOT of time. I just removed that feature for the time being.

Without metadata indexing, the program is similar to KJSearch - you can try that out for better information while indexing (check the link in the first post).

Share this post


Link to post
Share on other sites

I really have a problem with people not releasing the code. People here give credit when it is due, and by not sharing the code, why should we help you by giving comments and suggestions. Also when you do share the code, we will be able to help, and give advise in a much better way.


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

This forum is called Example Scripts, not Cool EXEs.

"Rampantly copying other people's work and changing stuff" is how we all learn to be better coders. If you fail to credit the people upon whose work you've built, and instead claim that you built everything from the ground up - well, if you post your source, it's fairly easy to spot other peoples work and call you out on it.

If however, you only post portions of code, how am I to know that you are not lifting some of my UDFs somewhere in your super-secret source code?

Why don't you make it really really super-secret, and just not post anything? Problem solved for everyone.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

@lod3n Exactly!!!!

Edited by Dethredic

"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I attempted decompile. And 'The requested file could not be extracted'. He did something to it. Are you really that paranoid about it?

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I really have a problem with people not releasing the code. People here give credit when it is due, and by not sharing the code, why should we help you by giving comments and suggestions. Also when you do share the code, we will be able to help, and give advise in a much better way.

I agree with you in principle. Here's credit where credit is due. A complete copy of a previous version of the program will be put up in a few minutes. Happy?

1. Reading Meta Data

(It was given to me without credit to anyone - the post where I asked for this is probably still in the help section)

(I don't have the original copy; I changed it in my program to support Windows Vista and to return only the data i needed)

Func getmeta(ByRef $f, ByRef $fpath, ByRef $fname, ByRef $fext, ByRef $fcat, ByRef $fmeta)
;gets the meta information of the file in question
;the meta data retrieved depends on the file category
;
;Parameters: $f = full path of the file
;            $fpath = file path
;            $fname = file name
;            $fext = file extension
;            $fcat = category into which the file falls
;       *    $fmeta = meta information sent back
;categories:
;   2 - executables
;   3 - documents
;   5 - multimedia
;
;Return Value: 0 - in case of error
;              1 - if meta information was retrieved successfully
    
    Local $oShellApp;shell application object instance
    Local $oDir;directory object instance
    Local $oFile;file object instance
    
    $oShellApp = ObjCreate("shell.application")
    $oDir = $oShellApp.NameSpace ($fpath)
    $oFile = $oDir.Parsename ($fname)
    
;BRANCHING OUT BASED ON OPERATING SYSTEM - ONLY FILE META LEFT TO BE OBTAINED
;file meta is a hidden field that won't be displayed to the user
;but its values help in determining search results
    If @OSVersion = "WIN_VISTA" Then
;source code for Microsoft Windows Vista
        
        $fmeta = " ";metadata clearing
        Switch $fcat
            Case 2
                If $fext = "exe" Then 
                    $fmeta = $oDir.GetDetailsOf ($oFile, 35)&" "&$oDir.GetDetailsOf ($oFile, 34)&" "&$oDir.GetDetailsOf ($oFile, 33)
        ;35 - Program Name
        ;33 - Company
        ;34 - Description
                EndIf
            Case 3;doc
                $fmeta = $oDir.GetDetailsOf ($oFile, 21)&" "&$oDir.GetDetailsOf ($oFile, 22)&" "&$oDir.GetDetailsOf ($oFile, 23)
    ;21 - Title
    ;22 - Subject
    ;23 - Category
            Case 5;mult
                If $fext = "mus" Then
                    $fmeta = $oDir.GetDetailsOf ($oFile, 21)&" "&$oDir.GetDetailsOf ($oFile, 13)&" "&$oDir.GetDetailsOf ($oFile, 14)
        ;21 - Song Name
        ;13 - Artist
        ;14 - Album Title
                EndIf
            Case Else
                Return 0;unsupported file category
        EndSwitch
;end of source code for Microsoft Windows Vista
    ElseIf @OSVersion = "WIN_XP" Or @OSVersion = "WIN_2003" Then
;source code for Microsoft Windows XP and Windows 2003
        
        $fmeta = " ";metadata clearing
        Switch $fcat
            Case 2
                If $fext = "exe" Then 
                    $fmeta = $oDir.GetDetailsOf ($oFile, 30)&" "&$oDir.GetDetailsOf ($oFile, 38)
        ;30 - Program Name
        ;38 - Product Name
                EndIf
            Case 5;mult
                If $fext = "mus" Then
                    $fmeta = $oDir.GetDetailsOf ($oFile, 10)&" "&$oDir.GetDetailsOf ($oFile, 16)&" "&$oDir.GetDetailsOf ($oFile, 17)
        ;10 - Song Name
        ;16 - Artist
        ;17 - Album Title
                EndIf
            Case Else
                Return 0;unsupported file category
        EndSwitch
;end of source code for Microsoft Windows XP and Windows 2003
    Else
        Err(861,"Unsupported Operating System.","This appears to be a poorly hacked version.")
    EndIf
    
    $fmeta = StringStripWS($fmeta,7);to remove spaces introduced by absent meta information
    If $fmeta = "" Then $fmeta = " "
    Return 1
EndFunc

2. Talk object

(erifash - correct me if I'm wrong)

Func _TalkOBJ($s_text)
    Local $o_speech
    $o_speech = ObjCreate("SAPI.SpVoice")
    $o_speech.Speak ($s_text)
    $o_speech = ""
EndFunc;==>_TalkOBJ

3. Round GUI Corners

(gafrost - http://www.autoitscript.com/forum/index.php?showtopic=12449)

Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
   Dim $pos, $ret, $ret2
   $pos = WinGetPos($h_win)
    $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long",  $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3,  "long", $i_y3)
   If $ret[0] Then
      $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)
      If $ret2[0] Then
         Return 1
      Else
         Return 0
      EndIf
   Else
      Return 0
   EndIf
EndFunc;==>_GuiRoundCorners
Edited by Koshy John

Share this post


Link to post
Share on other sites

This forum is called Example Scripts, not Cool EXEs.

"Rampantly copying other people's work and changing stuff" is how we all learn to be better coders. If you fail to credit the people upon whose work you've built, and instead claim that you built everything from the ground up - well, if you post your source, it's fairly easy to spot other peoples work and call you out on it.

If however, you only post portions of code, how am I to know that you are not lifting some of my UDFs somewhere in your super-secret source code?

Why don't you make it really really super-secret, and just not post anything? Problem solved for everyone.

I just hate to start an argument but I think you neglected to read the small type beneath the forum name. Here it is in bold:

A forum to share your cool scripts, User Defined Functions and AutoIt-based applications with others.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Source Code:

1. Main Program

[autoit]#NoTrayIcon

Opt("MustDeclareVars", 1) ;all variables must be predeclared

Opt("RunErrorsFatal", 0) ;silent error

Opt("TrayIconDebug", 0) ;no debug information

Break(0) ;user cannot exit from tray icon

#region - put the standard includes here

;

#endregion

;setting compile information

Global $title = "neoSearch";window title

Global $lname = "neoSearch", $sname = "nS"

Global $ver = "0.40", $vdate = "04 June 2007"

;setting path information

Global $wp = @AppDataDir & "\neoSearch"

Global $tp = @TempDir & "\nstd";neosearch temp dir

Global $iep = @ProgramFilesDir & "\Internet Explorer\iexplore.exe"

;master initialization

Global $logging = 0;no logging during startup phases

startup()

;starting logging procedure

If DirCreate($wp &"\logs") == 0 Then err(@ScriptLineNumber, "Unable to create logs folder.","Delete and recreate '" &$wp &"\logs'.")

Global $fh_log = FileOpen($wp &"\logs\nSMain " &@YEAR&"-"&@MON&"-"&@MDAY &".txt", 9);file handle to log file

$logging = 1;logs only if logging is 1

wlog(@CRLF&"neoSearch startup @ "&@hour&":"&@min&":"&@sec,1)

wlog(" User authenticated as: "&@UserName&@CRLF,1)

;starting main program

main()

Exit

; ============================================================================

; Main program code

; ============================================================================

Func main()

gui_init();initializing gui section

html_init();initializing html section

;initializing indexing engine

DirCreate($tp)

While 1

htmlgen(gstart())

WEnd

EndFunc

; including other sections

Func gui_init()

;stacks

Global $ctrllib[100][2]

Global $cltop = 0

Global $resno = 0;number of results on screen

Global $maxres = 4;maximum number of results displayable

;coordinates

Global $x_res = 0, $y_res = 76

Global $x_low = 0, $y_low = 320

;search ctrl id

Global $i_search;search input box

Global $gflag

;results holder

Global $resid[4][4]

Global $respath[4]

Global $oldquery;query entered by the user

Global $qfile;filehandle to be opened

iconexpand()

EndFunc

Func gstart()

Local $msg;window polling message

Local $mouse[5];polling the mouse

Local $m_last;ctrlid on in last polling

Local $m_click;storing the click state

Local $m_eval

Local $b_index;index button

Local $b_options;options button

Local $b_help;help button

Local $l_index;index button

Local $l_options;options button

Local $l_help;help button

Local $l_search;search for label

Local $b_search;search button

Local $winmin; windows min control id

Local $winclose;windows close control id

wlog("Creating the input gui")

If DirCreate ($wp &"\res") = 0 Then Err(@ScriptLineNumber,"Unable to create resource folder.")

_GuiRoundCorners(GuiCreate($title, 420, 380,-1, -1 , BitOR(0x80000000,$WS_BORDER)), 0, 0, 15, 15)

GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

GUISetBkColor(0xffffff)

;background images

FileInstall("res\top.jpg",$wp &"\res\top",1)

GUICtrlCreatePic ($wp &"\res\top",0,0,420,52);top background

GuiCtrlSetState(-1,$GUI_DISABLE)

FileDelete($wp &"\res\top")

FileInstall("res\bottom.jpg",$wp &"\res\bottom",1)

GUICtrlCreatePic ($wp &"\res\bottom",$x_low,$y_low,420,60);bottom background

GuiCtrlSetState(-1,$GUI_DISABLE)

FileDelete($wp &"\res\bottom")

;creating common controls

FileInstall("res\min0.jpg",$wp &"\res\min0",1)

FileInstall("res\min1.jpg",$wp &"\res\min1",1)

FileInstall("res\min2.jpg",$wp &"\res\min2",1)

$winmin = GUICtrlCreatePic ($wp &"\res\min0",340,0,26,17)

CAssign("ctrl_"& $winmin,$wp &"\res\min",2)

GUICtrlSetTip($winmin,"Minimize")

FileInstall("res\close0.jpg",$wp &"\res\close0",1)

FileInstall("res\close1.jpg",$wp &"\res\close1",1)

FileInstall("res\close2.jpg",$wp &"\res\close2",1)

$winclose = GUICtrlCreatePic ($wp &"\res\close0",365,0,43,17)

CAssign("ctrl_"& $winclose,$wp &"\res\close",2)

GUICtrlSetTip($winclose,"Close")

;menubar image

FileInstall("res\mbar0.jpg",$wp &"\res\mbar0",1)

GUICtrlCreatePic ($wp &"\res\mbar0",0,52,420,24)

FileDelete($wp &"\res\mbar0")

;menubar buttons

FileInstall("res\mbar0.jpg",$wp &"\res\mbar0",1)

FileInstall("res\mbar1.jpg",$wp &"\res\mbar1",1)

FileInstall("res\mbar2.jpg",$wp &"\res\mbar2",1)

;--index

$b_index = GUICtrlCreatePic($wp &"\res\mbar0",218,52,66,24)

GuiCtrlSetState(-1,$GUI_DISABLE)

CAssign("ctrl_"& $b_index,$wp &"\res\mbar",2)

$l_index = GUICtrlCreateLabel ("Index",233,55,40,20)

GUICtrlSetFont($l_index,11,400,0,"Tahoma")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

;--options

$b_options = GUICtrlCreatePic($wp &"\res\mbar0",218+66,52,80,24)

GuiCtrlSetState(-1,$GUI_DISABLE)

CAssign("ctrl_"& $b_options,$wp &"\res\mbar",2)

$l_options = GUICtrlCreateLabel ("Options",233+66,55,50,20)

GUICtrlSetFont($l_options,11,400,0,"Tahoma")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

;--help

$b_help = GUICtrlCreatePic($wp &"\res\mbar0",218+146,52,56,24)

GuiCtrlSetState(-1,$GUI_DISABLE)

CAssign("ctrl_"& $b_help,$wp &"\res\mbar",2)

$l_help = GUICtrlCreateLabel ("Info",233+146,55,40,20)

GUICtrlSetFont($l_help,11,400,0,"Tahoma")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

#region - code by Koshy John

;highlights

FileInstall("res\highlight0.jpg",$wp &"\res\highlight0",1)

FileInstall("res\highlight1.jpg",$wp &"\res\highlight1",1)

FileInstall("res\highlight2.jpg",$wp &"\res\highlight2",1)

$resid[0][3] = GUICtrlCreatePic($wp &"\res\highlight0",$x_res,$y_res,420,61)

$resid[1][3] = GUICtrlCreatePic($wp &"\res\highlight0",$x_res,$y_res+61,420,61)

$resid[2][3] = GUICtrlCreatePic($wp &"\res\highlight0",$x_res,$y_res+2*61,420,61)

$resid[3][3] = GUICtrlCreatePic($wp &"\res\highlight0",$x_res,$y_res+3*61,420,61)

;icons

$resid[0][0] = GUICtrlCreatePic($wp &"\res\blank",$x_res + 12,$y_res + 6,48,48)

$resid[1][0] = GUICtrlCreatePic($wp &"\res\blank",$x_res + 12,$y_res + 1*61 + 6,48,48)

$resid[2][0] = GUICtrlCreatePic($wp &"\res\blank",$x_res + 12,$y_res + 2*61 + 6,48,48)

$resid[3][0] = GUICtrlCreatePic($wp &"\res\blank",$x_res + 12,$y_res + 3*61 + 6,48,48)

;file names

$resid[0][1] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 12,330,20)

GUICtrlSetFont($resid[0][1],11,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

$resid[1][1] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 1*61 + 12,330,20)

GUICtrlSetFont($resid[1][1],11,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

$resid[2][1] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 2*61 + 12,330,20)

GUICtrlSetFont($resid[2][1],11,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

$resid[3][1] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 3*61 + 12,330,20)

GUICtrlSetFont($resid[3][1],11,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

;descriptions

$resid[0][2] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 27,330,20)

GUICtrlSetFont($resid[0][2],10,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

GUICtrlSetColor(-1,0x888888)

$resid[1][2] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 1*61 + 27,330,20)

GUICtrlSetFont($resid[1][2],10,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

GUICtrlSetColor(-1,0x888888)

$resid[2][2] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 2*61 + 27,330,20)

GUICtrlSetFont($resid[2][2],10,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

GUICtrlSetColor(-1,0x888888)

$resid[3][2] = GUICtrlCreateLabel (" ",$x_res + 12 + 48 + 12,$y_res + 3*61 + 27,330,20)

GUICtrlSetFont($resid[3][2],10,400,0,"Trebuchet MS")

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

GUICtrlSetColor(-1,0x888888)

#endregion - end of dummy results

;search label

$l_search = GUICtrlCreateLabel ("Search for:",$x_low + 31,$y_low + 20,60,20)

GUICtrlSetFont($l_search,9,400,0,"Tahoma")

GUICtrlSetColor(-1,0xffffff)

GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)

;search input

$i_search = GUICtrlCreateInput("",$x_low + 107,$y_low + 15,230,23);search input box

GUICtrlSetFont($i_search,10,400,0,"Tahoma")

;search button

FileInstall("res\search0.jpg",$wp &"\res\search0",1)

FileInstall("res\search1.jpg",$wp &"\res\search1",1)

FileInstall("res\search2.jpg",$wp &"\res\search2",1)

$b_search = GUICtrlCreatePic ($wp &"\res\search0",$x_low+107+230,$y_low+16,26,22)

Local $b_searchproxy = GUICtrlCreateButton("", 800, 800, 0, 0, $BS_DEFPUSHBUTTON)

CAssign("ctrl_"& $b_search,$wp &"\res\search",2)

GUICtrlSetTip($b_search,"Search")

GUISetState()

WinSetTrans($title,"",240)

If FileExists ($wp &"\data\nsraw.dat") = 0 Then

If FileExists ($wp &"\nSindex.exe") = 0 Then FileInstall("index\nSindex.exe",$wp &"\nSindex.exe",1)

Run($wp &"\nSindex.exe")

sleep(500)

If ProcessExists ("nSindex.exe") Then MsgBox(64,$title &" Indexing Engine","No index was found. Indexing has been started.")

EndIf

While 1

$msg = GUIGetMsg ()

displayres(GUICtrlRead($i_search))

;contingencies

If $msg = $l_index Then $msg = $b_index

If $msg = $l_options Then $msg = $b_options

If $msg = $l_help Then $msg = $b_help

For $i = 0 To 3

For $j = 0 To 3

If $msg = $resid[$i][$j] Then $msg = $resid[$i][3]

Next

Next

;hover effects code

$mouse = GUIGetCursorInfo()

If Not (@error) Then

;contingencies

If $mouse[4] = $l_index Then $mouse[4] = $b_index

If $mouse[4] = $l_options Then $mouse[4] = $b_options

If $mouse[4] = $l_help Then $mouse[4] = $b_help

For $i = 0 To 3

For $j = 0 To 3

If $mouse[4] = $resid[$i][$j] Then $mouse[4] = $resid[$i][3]

Next

Next

If $mouse[4] <> $m_last Then

;gui needs update because mouse has affected it

$m_eval = CGetVal("ctrl_" &$m_last)

If $m_eval <> "" Then GUICtrlSetImage ($m_last,$m_eval &"0");reseting old

$m_eval = CGetVal("ctrl_" &$mouse[4])

If $m_eval <> "" Then

If $mouse[2] Then

GUICtrlSetImage ($mouse[4],$m_eval &"2");clicked new

Else

GUICtrlSetImage ($mouse[4],$m_eval &"1");hover new

EndIf

EndIf

ElseIf $mouse[2] <> $m_click Then

If $mouse[2] Then

GUICtrlSetImage ($m_last,$m_eval &"2");clicked old

Else

GUICtrlSetImage ($m_last,$m_eval &"1");hover old

EndIf

EndIf

If $m_click = 1 And $mouse[2] = 0 Then

$msg = $m_last

ElseIf CGetVal("ctrl_" &$msg) <> "" Then

ContinueLoop

EndIf

$m_last = $mouse[4]

$m_click = $mouse[2]

EndIf

;click effects code

Select

Case $msg = $GUI_EVENT_CLOSE Or $msg = $winclose

;trans out only if the OS is not vista

#region - code by Koshy John

Local $i = 254

ProcessSetPriority("neoSearch.exe",3)

While $i > 0

WinSetTrans($title, "Index", $i)

If $i < 50 Then

$i = $i - 20

ElseIf $i < 100 Then

$i = $i - 18

ElseIf $i < 200 Then

$i = $i - 12

Else

$i = $i - 8

EndIf

Sleep(10)

WEnd

GUIDelete()

#endregion

Exit

Case $msg = $winmin

GUISetState(@SW_MINIMIZE)

;results clicked

Case $msg = $resid[0][3]

If CGetVal("ctrl_"& $resid[0][3]) == 0 Then

sleep(1)

Else

ShellExecute($respath[0])

EndIf

Case $msg = $resid[1][3]

If CGetVal("ctrl_"& $resid[1][3]) == 0 Then

sleep(1)

Else

ShellExecute($respath[1])

EndIf

Case $msg = $resid[2][3]

If CGetVal("ctrl_"& $resid[2][3]) == 0 Then

sleep(1)

Else

ShellExecute($respath[2])

EndIf

Case $msg = $resid[3][3]

If CGetVal("ctrl_"& $resid[3][3]) == 0 Then

sleep(1)

Else

ShellExecute($respath[3])

EndIf

;search

Case $msg = $b_search Or $msg = $b_searchproxy

$msg = GUICtrlRead($i_search)

If StringStripWS($msg,7) <> "" Then

GUIDelete ()

Return $msg

Else

GUICtrlSetData($i_search,"Please enter a valid search term...")

sleep(1000)

GUICtrlSetData($i_search,"")

EndIf

;buttons on menu bar

Case $msg = $b_index

If ProcessExists ("nSindex.exe") = 0 Then

If MsgBox(36,$title &" Indexing Engine","Status: Not running"&@CRLF&"Do you want to start indexing?") = 6 Then

If FileExists ($wp &"\nSindex.exe") = 0 Then FileInstall("index\nSindex.exe",$wp &"\nSindex.exe",1)

Run($wp &"\nSindex.exe")

sleep(250)

If ProcessExists ("nSindex.exe") = 0 Then MsgBox(64,$title &" Indexing Engine","Unable to start indexing procedures.")

If FileExists ($wp &"\data\nsraw.dat") Then ProcessSetPriority ("nSindex.exe",1)

EndIf

Else

If MsgBox(36,$title &" Indexing Engine","Status: Running in the background"&@CRLF&"Do you want to stop indexing?") = 6 Then

While ProcessExists ("nSindex.exe")

ProcessClose ("nSindex.exe")

WEnd

sleep (50)

DirRemove ($wp &"\temp",1)

If ProcessExists ("nSindex.exe") Then MsgBox(64,$title &" Indexing Engine","Unable to stop indexing engine.")

EndIf

EndIf

Case $msg = $b_options

If FileExists ($wp &"\paths.txt") = 0 Then FileClose(FileOpen($wp &"\paths.txt",2))

If FileExists ($wp &"\exclude.txt") = 0 Then FileClose(FileOpen($wp &"\exclude.txt",2))

ShellExecuteWait($wp &"\paths.txt")

ShellExecuteWait($wp &"\exclude.txt")

Case $msg = $b_help

MsgBox (64,"About " &$title,"neoSearch" &@CRLF&@CRLF &"version: 1.0"&@CRLF&"compiled on: 25 June 2007" &@CRLF&@CRLF&"Koshy John")

EndSelect

WEnd

wlog("Input GUI closed.")

EndFunc

Func CAssign($var,$data,$flag)

Local $point

For $point = 0 To $cltop

If $var <> $ctrllib[$point][0] Then ContinueLoop

$ctrllib[$point][1] = $data

Return

Next

$ctrllib[$cltop][0] = $var

$ctrllib[$cltop][1] = $data

$cltop = $cltop + 1

EndFunc

Func CGetVal($var)

Local $point

For $point = 0 To $cltop - 1

If $var <> $ctrllib[$point][0] Then ContinueLoop

Return $ctrllib[$point][1]

Next

Return 0

EndFunc

Func iconexpand()

DirCreate ($wp &"\res")

FileInstall("res\ico\blank.jpg",$wp &"\res\blank",1)

FileInstall("res\ico\dir.jpg",$wp &"\res\dir",1)

FileInstall("res\ico\doc.jpg",$wp &"\res\doc",1)

FileInstall("res\ico\exe.jpg",$wp &"\res\exe",1)

FileInstall("res\ico\htm.jpg",$wp &"\res\htm",1)

FileInstall("res\ico\img.jpg",$wp &"\res\img",1)

FileInstall("res\ico\lnk.jpg",$wp &"\res\lnk",1)

FileInstall("res\ico\mov.jpg",$wp &"\res\mov",1)

FileInstall("res\ico\mus.jpg",$wp &"\res\mus",1)

FileInstall("res\ico\pdf.jpg",$wp &"\res\pdf",1)

FileInstall("res\ico\pps.jpg",$wp &"\res\pps",1)

FileInstall("res\ico\ppt.jpg",$wp &"\res\ppt",1)

FileInstall("res\ico\pub.jpg",$wp &"\res\pub",1)

FileInstall("res\ico\rar.jpg",$wp &"\res\rar",1)

FileInstall("res\ico\rm.jpg",$wp &"\res\rm",1)

FileInstall("res\ico\txt.jpg",$wp &"\res\txt",1)

FileInstall("res\ico\vid.jpg",$wp &"\res\vid",1)

FileInstall("res\ico\xls.jpg",$wp &"\res\xls",1)

FileInstall("res\ico\xps.jpg",$wp &"\res\xps",1)

FileInstall("res\ico\zip.jpg",$wp &"\res\zip",1)

EndFunc

Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)

Dim $pos, $ret, $ret2

$pos = WinGetPos($h_win)

$ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3)

If $ret[0] Then

$ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)

If $ret2[0] Then

Return 1

Else

Return 0

EndIf

Else

Return 0

EndIf

EndFunc

Func html_init()

DirRemove($tp,1)

DirCreate($tp)

FileInstall("html\dir.jpg",$tp &"\dir.jpg",1)

FileInstall("html\doc.jpg",$tp &"\doc.jpg",1)

FileInstall("html\exe.jpg",$tp &"\exe.jpg",1)

FileInstall("html\lnk.jpg",$tp &"\lnk.jpg",1)

FileInstall("html\htm.jpg",$tp &"\htm.jpg",1)

FileInstall("html\img.jpg",$tp &"\img.jpg",1)

FileInstall("html\mov.jpg",$tp &"\mov.jpg",1)

FileInstall("html\mus.jpg",$tp &"\mus.jpg",1)

FileInstall("html\pdf.jpg",$tp &"\pdf.jpg",1)

FileInstall("html\pps.jpg",$tp &"\pps.jpg",1)

FileInstall("html\ppt.jpg",$tp &"\ppt.jpg",1)

FileInstall("html\pub.jpg",$tp &"\pub.jpg",1)

FileInstall("html\rar.jpg",$tp &"\rar.jpg",1)

FileInstall("html\rm.jpg",$tp &"\rm.jpg",1)

FileInstall("html\txt.jpg",$tp &"\txt.jpg",1)

FileInstall("html\vid.jpg",$tp &"\vid.jpg",1)

FileInstall("html\xls.jpg",$tp &"\xls.jpg",1)

FileInstall("html\xps.jpg",$tp &"\xps.jpg",1)

FileInstall("html\zip.jpg",$tp &"\zip.jpg",1)

FileInstall("html\alfamagkj",$tp &"\alfamagkj",1)

FileInstall("html\hl91",$tp &"\hl91",1)

FileInstall("html\wp.360",$tp &"\wp.360",1)

FileInstall("html\xoskel",$tp &"\xoskel",1)

FileInstall("html\http404",$tp &"\http404",1)

EndFunc

Func htmlgen($query)

;code by Koshy John

Local $queryS[3]

Local $f1

Local $starword

Local $tags

Local $fcode

$query = StringStripWS($query,7)

If $query = "" Then Return

$qfile = $wp & "\data\" & StringLeft ($query, 2) & ".dat"

If FileExists( $qfile) = 0 Then $qfile = $wp & "\data\" & StringLeft($query, 1) & ".dat"

If FileExists ($qfile) = 0 Then Return

$qfile = FileOpen ($qfile,0)

If $qfile = -1 Then Return

;logically splitting the query

$queryS = StringSplit ($query," ._-(")

FileDelete($tp &"\results.htm")

FileInstall("html\results.htm",$tp &"\results.htm",1)

Local $fp = FileOpen($tp &"\results.htm",1)

Local $timetaken = TimerInit ()

Local $dfiles = 0

While 1

$starword = FileReadLine ($qfile)

If @error Then ExitLoop

$tags = FileReadLine ($qfile)

FileReadLine ($qfile)

FileReadLine ($qfile)

FileReadLine ($qfile)

FileReadLine ($qfile)

FileReadLine ($qfile)

FileReadLine ($qfile)

$fcode = FileReadLine ($qfile)

If StringInStr ($starword, $queryS[1]) = 0 Then ContinueLoop

For $i = 1 To $queryS[0]

If StringInStr ($tags, $queryS[$i]) = 0 Then ContinueLoop 2

Next

$dfiles = $dfiles + 1

FileWriteLine($fp,$fcode)

WEnd

FileClose($qfile)

FileWriteLine($fp, "</table>")

If $dfiles == 0 Then FileWriteLine($fp, "<p></p><center><img src=http404><font face=Tahoma size=4 color=gray> No folders or files of this type were found! </font><p><font face=Tahoma size=2 color=lightgray>Try some other file type(s) or search term(s). </font></p></center>")

FileWriteLine($fp, "<p></p><p></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .75pt;padding:0in 0in 1.0pt 0in'></div><p></p><p></p>")

FileWriteLine($fp, "<table border=0 cellspacing=0 cellpadding=0><tr><td><font size=2><b> You searched for '" & $query & "' on " & @ComputerName & ".</b></font></td></tr>")

FileWriteLine($fp, "<tr><td><font size=2><b> Files/Folders Found: " & $dfiles & "</b></font></td></tr>")

FileWriteLine($fp, "<tr><td><font size=2><b> Time Taken : "&Round(TimerDiff($timetaken) / 1000, 2)&" secs</b></font></td></tr></table><p></p>")

FileWriteLine($fp, "<font size=2><b>

Edited by Koshy John

Share this post


Link to post
Share on other sites

where r the guys who promised a lot of "comments and suggestions" if i shared the source?

seriously...

Share this post


Link to post
Share on other sites

Hi,

I wasn't one to eg you on!.

But it looks interesting, though doesn't run; if you're still develping it, i would lose the DOS; see my post today;

Best, Randall

SearchMiner ; modified Search Engine, non-Dos option for Extended characters in file names

Share this post


Link to post
Share on other sites

Was that so hard...

I although i haven't studied the code, I can say it is neat, organized and easy to read. Good work!


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

Hi,

I wasn't one to eg you on!.

But it looks interesting, though doesn't run; if you're still develping it, i would lose the DOS; see my post today;

Best, Randall

SearchMiner ; modified Search Engine, non-Dos option for Extended characters in file names

I think it handles extended characters.. if what you suggest by extended characters is u (micro) and the like...

I did one without the DOS using a recursive version of FileFindFirstFile/NextFile but the script used to crash (hard crash) when AutoIt tried to recurse into directories like "System Volume Information" and a couple of other directories like that within the windows folder itself (didn't want surprise directories on some random user's computer to ruin the experience). I stuck to DOS for that reason and for the reason that it was much faster. I've run thousands of test cases over the last year and this is as far as I've come so far.

Your code is very impressive. Off hand I would say the differences between our code is that I've decided to allocate more time to indexing so as to get Google Desktop like search times while you've reduced indexing time but with a penalty of about 30 times the time taken for a single search.

Would you like to compete? :whistle:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0