Everything Search Tool

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 182
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 17 times
Been thanked: 21 times

Everything Search Tool

Post by AUGE_OHR » Sat Nov 09, 2019 1:24 am

hi,

did you often search a file :?:

i most have used Total Commander and ALT-F7
since TC Version 8.5x there was a Option "Everything" ... hm

i install it from
https://www.voidtools.com/
and it search now much faster than before. :o

i found out that i can use Everything.DLL in my Xbase++ App.

this Version now is for harbour / HMG
hb_Everything.jpg
hb_Everything.jpg (180.42 KiB) Viewed 224 times
HBEVERY.ZIP
(2.42 KiB) Downloaded 36 times
! Note : have use BCC582 see HBC

---

Question : how to detect if a DLL can be load :?:

Code: Select all

   nDLL := LoadLibrary("Everything32.dll")
this Code does not work with HMG (perhaps Extended Version can do it)

User avatar
AUGE_OHR
Posts: 182
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 17 times
Been thanked: 21 times

Post by AUGE_OHR » Sat Nov 09, 2019 4:31 am

when found what you search you can "goto" it with this Code

add under GRID_1

Code: Select all

    ON DBLCLICK GoToDir(EVFORM.Grid_1.Value,ThisWindow.Name,This.Name)
and insert this Code

Code: Select all

STATIC PROCEDURE GoToDir(nDir,cForm,cGrid)
LOCAL cText  := ""
LOCAL cPath  := ""

   cPath := GetProperty( cForm, cGrid, "CELL", nDir, 1 )

   cText  := "explorer /e,/select,"+cPath
   MemoWrit("ChangeDir.BAT",cText)

   RUN ChangeDir.BAT

RETURN

User avatar
jairpinho
Posts: 344
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Has thanked: 3 times
Been thanked: 11 times
Contact:

Post by jairpinho » Sat Nov 09, 2019 6:21 pm

AUGE_OHR wrote:
Sat Nov 09, 2019 1:24 am
hi,

did you often search a file :?:

i most have used Total Commander and ALT-F7
since TC Version 8.5x there was a Option "Everything" ... hm

i install it from
https://www.voidtools.com/
and it search now much faster than before. :o

i found out that i can use Everything.DLL in my Xbase++ App.

this Version now is for harbour / HMG
hb_Everything.jpg

HBEVERY.ZIP

! Note : have use BCC582 see HBC

---

Question : how to detect if a DLL can be load :?:

Code: Select all

   nDLL := LoadLibrary("Everything32.dll")
this Code does not work with HMG (perhaps Extended Version can do it)

hello could do with ide use without using bcc582
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

User avatar
AUGE_OHR
Posts: 182
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 17 times
Been thanked: 21 times

Post by AUGE_OHR » Sat Nov 09, 2019 7:08 pm

hi,
jairpinho wrote:
Sat Nov 09, 2019 6:21 pm
hello could do with ide use without using bcc582
i have take out from hbEVERY.HBC

Code: Select all

libpaths=C:\BCC582\lib
and it still work with HMG IDE

User avatar
AUGE_OHR
Posts: 182
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 17 times
Been thanked: 21 times

Post by AUGE_OHR » Sun Nov 10, 2019 9:21 am

hi,

forgot to say : please download 32 Bit (!) Version of Everything.

have not test it with harbour / HMG 64 Bit yet.

---

Demo Code use "A"nsi function
if you need Unicode please change those "A" function to "W"

User avatar
AUGE_OHR
Posts: 182
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 17 times
Been thanked: 21 times

Post by AUGE_OHR » Mon Nov 11, 2019 12:08 am

i also use Everything to find files with Attribut "A" for Backup.

you have to configure Everything in Setup and enable Attribut.
Every_Setup.jpg
Every_Setup.jpg (87.42 KiB) Viewed 63 times
than you can search with

Code: Select all

"D:\ALASKA\ attrib:A"
this will search for all files with Attribut "A" under D:\ALASKA\

you have to modify Code for Attribut with other Constant this Way

Code: Select all

      // set search
      @ Everything32:Everything_SetSearchA( cText )

      // what to search
      @ Everything32:Everything_SetRequestFlags( nor( EVERYTHING_REQUEST_PATH, EVERYTHING_REQUEST_FILE_NAME, EVERYTHING_REQUEST_ATTRIBUTES, EVERYTHING_REQUEST_EXTENSION ) )

      // sort result
      @ Everything32:Everything_SetSort( EVERYTHING_SORT_ATTRIBUTES_DESCENDING )

      // execute the query
      @ Everything32:Everything_QueryA( .T. )

      nNum := @Everything32:Everything_GetNumResults()
      FOR n := 1 TO nNum
         // is it a File (other are Folder/Volumn
         bIsFileResult := @Everything32:Everything_IsFileResult(n-1)
         IF bIsFileResult = 1
            // get full path filename
            buf := SPACE( bufsize )
            @ Everything32:Everything_GetResultFullPathNameA( n-1, @buf, bufsize )

            cItem := ALLTRIM( STRTRAN(buf,CHR(0),"") )
            IF IsFileNotDir(cItem)
               // check for Attribute
               nAttribut := @ Everything32:Everything_GetResultAttributes(n-1)
               cAttribut := Num2Attribut(nAttribut)
               DO CASE
                  CASE "H" $ cAttribut
                  CASE "D" $ cAttribut
                  CASE "A" $ cAttribut
                     AADD( aResult, {cItem,LTRIM(STR(nAttribut)),cAttribut} )
               ENDCASE
            ENDIF
         ENDIF
      NEXT


Code: Select all

FUNCTION Num2Attribut(nMode)
LOCAL cRet  := ""
LOCAL nRest := 0
LOCAL i,iMax
LOCAL aType := {;
{EVERYTHING_FILE_ATTRIBUTE_READONLY           ,"READONLY           ","R" },;
{EVERYTHING_FILE_ATTRIBUTE_HIDDEN             ,"HIDDEN             ","H" },;
{EVERYTHING_FILE_ATTRIBUTE_SYSTEM             ,"SYSTEM             ","S" },;
{EVERYTHING_FILE_ATTRIBUTE_DIRECTORY          ,"DIRECTORY          ","D" },;
{EVERYTHING_FILE_ATTRIBUTE_ARCHIVE            ,"ARCHIVE            ","A" },;
{EVERYTHING_FILE_ATTRIBUTE_DEVICE             ,"DEVICE             ","V" },;
{EVERYTHING_FILE_ATTRIBUTE_NORMAL             ,"NORMAL             ","N" },;
{EVERYTHING_FILE_ATTRIBUTE_TEMPORARY          ,"TEMPORARY          ","T" },;
{EVERYTHING_FILE_ATTRIBUTE_SPARSE_FILE        ,"SPARSE_FILE        ","S" },;
{EVERYTHING_FILE_ATTRIBUTE_REPARSE_POINT      ,"REPARSE_POINT      ","P" },;
{EVERYTHING_FILE_ATTRIBUTE_COMPRESSED         ,"COMPRESSED         ","C" },;
{EVERYTHING_FILE_ATTRIBUTE_OFFLINE            ,"OFFLINE            ","O" },;
{EVERYTHING_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,"NOT_CONTENT_INDEXED","I" },;
{EVERYTHING_FILE_ATTRIBUTE_ENCRYPTED          ,"ENCRYPTED          ","E" } }

   ASORT(aType,,,{|aX,aY| aX[1] > aY[1]})

   nRest := nMode

   DO WHILE .T.
      IF nRest > aType[1,1]
        nRest -= aType[1,1]
      ELSE
         EXIT
      ENDIF
   ENDDO

   iMax  := LEN(aType)
   FOR i := 1 TO iMax
      IF nRest > 0
      ELSE
         EXIT
      ENDIF
      IF aType[i,1] $ nRest
        cRet  += aType[i,3]
        nRest -= aType[i,1]
      ENDIF
   NEXT

RETURN cRet

FUNCTION IsDir(cDirName)     // NO wildcards !!!
   local aNames, lReturn
   if right(cDirName,1) = "\"
      cDirName := left(cDirName,len(cDirName)-1)
   endif
   aNames := directory(cDirName,"D")
   if empty(aNames)
      lReturn := .f.
   else
      lReturn := .t.
   endif
return lReturn

FUNCTION IsFileNotDir(cItem)
   local aNames, lReturn := .F.

   aNames := directory(cItem,"D")
   if empty(aNames)
      lReturn := .f.
   else
      IF EMPTY(aNames[1][F_SIZE] )
         lReturn := .f.
      ELSE
         lReturn := .t.
      endif
   endif
return lReturn
i use Array with full-path-filename with ShOperation API to copy it to USB-Stick / Drive

have fun

Post Reply