did somebody work with Everything under Fivewin
http://www.voidtools.com/
---
for Xbase++ and HMG i use DllCall but under Fivewin i got Empty Array
i guess it have to do with calling Type where is use "only" DLL_OSAPI under Xbase++
under HMG i have to use for Unicode
- Code: Select all Expand view RUN
- nNum := DllCall( nDLL, HB_DYN_CTYPE_LONG, "Everything_GetNumResults" )
or ANSI
- Code: Select all Expand view RUN
- nNum := DllCall( nDLL, HB_DYN_CTYPE_INT, "Everything_GetNumResults" )
but Fivewin sems to need "more" ... who can help
- Code: Select all Expand view RUN
- #include "DLL.CH"
#include "hbdyn.ch"
STATIC FUNCTION DOEveryThing( cMask )
LOCAL aResult := {}
LOCAL aItems := {}
LOCAL bufsize := 250
LOCAL nRet := 0
LOCAL nDll
LOCAL nNum, n
LOCAL cItem
LOCAL hGrid
LOCAL buf
* nDLL := DLLCall( "Kernel32.dll",DLL_OSAPI, "LoadLibrary", "Everything32.dll" )
* IF nDLL > 0
nDll := "Everything32.dll"
// set thesearch
IF hb_cdpSelect() = "UTF8" .or. .T.
nRet := DllCall( nDLL,, "Everything_SetSearchW", cMask )
ELSE
nRet := DllCall( nDLL,, "Everything_SetSearchA", cMask )
ENDIF
FWLOG 1,nRet
// request name and size
nRet := DllCall( nDLL,, "Everything_SetRequestFlags", nOr( EVERYTHING_REQUEST_PATH, EVERYTHING_REQUEST_FILE_NAME, EVERYTHING_REQUEST_SIZE ) )
FWLOG 2,nRet
// sort by size
// @Everything32:Everything_SetSort(EVERYTHING_SORT_SIZE_DESCENDING)
// sort by name
// @Everything32:Everything_SetSort(EVERYTHING_SORT_NAME_ASCENDING)
// sort by path
// @Everything32:Everything_SetSort(EVERYTHING_SORT_PATH_ASCENDING)
nRet := DllCall( nDLL,, "Everything_SetSort", EVERYTHING_SORT_FILE_LIST_FILENAME_ASCENDING )
FWLOG 3,nRet
// execute the query
IF hb_cdpSelect() = "UTF8" .or. .T.
nRet := DllCall( nDLL, , "Everything_QueryW", .T. )
nNum := DllCall( nDLL, HB_DYN_CTYPE_LONG, "Everything_GetNumResults" )
ELSE
nRet := DllCall( nDLL,, "Everything_QueryA", .T. )
nNum := DllCall( nDLL, HB_DYN_CTYPE_INT, "Everything_GetNumResults" )
ENDIF
FWLOG 4, nRet, nNum
FOR n := 1 TO nNum
buf := SPACE( bufsize )
IF hb_cdpSelect() = "UTF8" .or. .T.
nRet := DllCall( nDLL,, "Everything_GetResultFullPathNameW", n, @buf, bufsize )
ELSE
nRet := DllCall( nDLL,, "Everything_GetResultFullPathNameA", n, @buf, bufsize )
ENDIF
FWLOG 5,nRet
AADD( aResult, UPPER( TRIM( buf ) ) )
NEXT
// sort it here
aResult := ASORT( aResult )
nNum := LEN( aResult )
FOR n := 1 TO nNum
cItem := aResult[ n ]
cItem := STRTRAN( cItem, CHR( 0 ), "" )
cItem := TRIM( cItem )
IF EMPTY( cItem )
LOOP
ENDIF
AADD( aItems, { cItem } )
NEXT
FreeLibrary( nDLL )
//
* ELSE
* MsgInfo( "need Everything32.dll !" + CRLF + ;
* "you can get it at" + CRLF + ;
* "http://www.voidtools.com/" )
* ENDIF
RETURN ACLONE(aItems)
! Note : have add ""UTF8" .or. .T." while ANSI Version crash