Suche funktionierende Zip UDF

  • Hi,

    ich suche eine funktionierende UDF um Zip zu entpacken. Hab hier schon einige gefunden die aber entweder garnichtmehr gehen oder zumindestens unter Vista nicht.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Hatte ich schon funktioniert aber nichtmehr.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Wie gesagt kenne ich diese UDF und sie funktioniert aber nichtmehr.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Die 7-zip32.dll hab ich dabei. Erstmal bringt die UDF an sicht einen haufen fehler weil die @error irgendwie als Const ist und dann passiert rein garnichts wenn ich die _SevenZipExtract aufrufe.

    Edit. So nachdem ich mir nun verschiedene Versionen von dieser UDF angeschaut habe, startet zumindestens einen den entpackforgang zumindestens so lange bis autoit wegen unerwartetem Fehler von Windows beendet wird.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

    Einmal editiert, zuletzt von chip (12. Oktober 2009 um 13:41)

  • Kein Unterschied. Das Script wird nach dem halben entpacken der zip-Datei von Windows beendet weil es nichtmehr reagiert.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Also diese UDF funktioniert auf jeden Fall:

    Spoiler anzeigen
    [autoit]

    ; #VARIABLES# ===================================================================================================================
    Global $hDLL_7ZIP = DllOpen(@ScriptDir & "\7-zip32.dll")
    If $hDLL_7ZIP = -1 Then Exit 1

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $FNAME_MAX32 = 512
    Global $hArchiveProc

    [/autoit] [autoit][/autoit] [autoit]

    ;File attributes constants
    Global Const $FA_RDONLY = 0x01 ;Reading private file
    Global Const $FA_HIDDEN = 0x02 ;Invisibility attribute file
    Global Const $FA_SYSTEM = 0x04 ;System file
    Global Const $FA_LABEL = 0x08 ;Volume label
    Global Const $FA_DIREC = 0x10 ;Directory
    Global Const $FA_ARCH = 0x20 ;Retention bit
    Global Const $FA_ENCRYPTED = 0x40 ;The password the file which is protected
    ; ===============================================================================================================================

    [/autoit] [autoit][/autoit] [autoit]

    ; #STRUCTURES# ==================================================================================================================
    Global $tagINDIVIDUALINFO = "int dwOriginalSize;int dwCompressedSize;int dwCRC;uint uFlag;uint uOSType;short wRatio;" & _
    "short wDate;short wTime;char szFileName[" & $FNAME_MAX32 + 1 & "];char dummy1[3];" & _
    "char szAttribute[8];char szMode[8]"

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $tagEXTRACTINGINFO = "int dwFileSize;int dwWriteSize;char szSourceFileName[" & $FNAME_MAX32 + 1 & "];" & _
    "char dummy1[3];char szDestFileName[" & $FNAME_MAX32 + 1 & "];char dummy[3]"

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $tagEXTRACTINGINFOEX = $tagEXTRACTINGINFO & ";dword dwCompressedSize;dword dwCRC;uint uOSType;short wRatio;" & _
    "short wDate;short wTime;char szAttribute[8];char szMode[8]"
    ; ===============================================================================================================================

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipAdd
    ; Description ...: Adds files to archive
    ; Syntax.........: _7ZipAdd($hWnd, $sArcName, $sFileName[, $sHide = 0[, $sCompress = 5[, $sRecurse = 1[, $sIncludeFile = 0[, _
    ; $sExcludeFile = 0[, $sPassword = 0[, $sSFX = 0[, $sVolume = 0[, $sWorkDir = 0]]]]]]]]])
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; $sArcName - Archive file name
    ; $sFileName - File names to archive up
    ; $sHide - Use this switch if you want the CallBack function to be called
    ; $sCompress - Compress level 0-9
    ; $sRecurse - Recursion method: 0 - Disable recursion
    ; 1 - Enable recursion
    ; 2 - Enable recursion only for wildcard names
    ; $sIncludeFile - Include filenames, specifies filenames and wildcards or list file that specify processed files
    ; $sExcludeFile - Exclude filenames, specifies what filenames or (and) wildcards must be excluded from operation
    ; $sPassword - Specifies password
    ; $sSFX - Creates self extracting archive
    ; $sVolume - Specifies volumes sizes
    ; $sWorkDir - Sets working directory for temporary base archive
    ; Return values .: Success - Returns the string with results
    ; Failure - Returns 0 and and sets the @error flag to 1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipAdd($hWnd, $sArcName, $sFileName, $sHide = 0, $sCompress = 5, $sRecurse = 1, $sIncludeFile = 0, $sExcludeFile = 0, _
    $sPassword = 0, $sSFX = 0, $sVolume = 0, $sWorkDir = 0)

    [/autoit] [autoit][/autoit] [autoit]

    $sArcName = '"' & $sArcName & '"'
    $sFileName = '"' & $sFileName & '"'

    Local $iSwitch = ""

    If $sHide Then $iSwitch &= " -hide"

    $iSwitch &= " -mx" & $sCompress
    $iSwitch &= _RecursionSet($sRecurse)

    If $sIncludeFile Then $iSwitch &= _IncludeFileSet($sIncludeFile)
    If $sExcludeFile Then $iSwitch &= _ExcludeFileSet($sExcludeFile)

    If $sPassword Then $iSwitch &= " -p" & $sPassword

    If FileExists($sSFX) Then $iSwitch &= " -sfx" & $sSFX

    If $sVolume Then $iSwitch &= " -v" & $sVolume

    If $sWorkDir Then $iSwitch &= " -w" & $sWorkDir

    Local $tOutBuffer = DllStructCreate("char[32768]")

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZip", _
    "hwnd", $hWnd, _
    "str", "a " & $sArcName & " " & $sFileName & " " & $iSwitch, _
    "ptr", DllStructGetPtr($tOutBuffer), _
    "int", DllStructGetSize($tOutBuffer))

    If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1))
    Return SetError(1, 0, 0)
    EndFunc ;==>_7ZipAdd

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipDelete
    ; Description ...: Deletes files from archive
    ; Syntax.........: _7ZipDelete($hWnd, $sArcName, $sFileName[, $sHide = 0[, $sCompress = 5[, $sRecurse = 1[, $sIncludeFile = 0[, _
    ; $sExcludeFile = 0[, $sPassword = 0[, $sWorkDir = 0]]]]]]])
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; $sArcName - Archive file name
    ; $sFileName - File names to deleting
    ; $sHide - Use this switch if you want the CallBack function to be called
    ; $sCompress - Compress level 0-9
    ; $sRecurse - Recursion method: 0 - Disable recursion
    ; 1 - Enable recursion
    ; 2 - Enable recursion only for wildcard names
    ; $sIncludeFile - Include filenames, specifies filenames and wildcards or list file that specify processed files
    ; $sExcludeFile - Exclude filenames, specifies what filenames or (and) wildcards must be excluded from operation
    ; $sPassword - Specifies password
    ; $sWorkDir - Sets working directory for temporary base archive
    ; Return values .: Success - Returns the string with results
    ; Failure - Returns 0 and and sets the @error flag to 1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipDelete($hWnd, $sArcName, $sFileName, $sHide = 0, $sCompress = 5, $sRecurse = 1, $sIncludeFile = 0, $sExcludeFile = 0, _
    $sPassword = 0, $sWorkDir = 0)

    $sArcName = '"' & $sArcName & '"'
    $sFileName = '"' & $sFileName & '"'

    Local $iSwitch = ""

    If $sHide Then $iSwitch &= " -hide"

    $iSwitch &= " -mx" & $sCompress
    $iSwitch &= _RecursionSet($sRecurse)

    If $sIncludeFile Then $iSwitch &= _IncludeFileSet($sIncludeFile)

    If $sExcludeFile Then $iSwitch &= _ExcludeFileSet($sExcludeFile)

    If $sPassword Then $iSwitch &= " -p" & $sPassword
    If $sWorkDir Then $iSwitch &= " -w" & $sWorkDir

    Local $tOutBuffer = DllStructCreate("char[32768]")

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZip", _
    "hwnd", $hWnd, _
    "str", "d " & $sArcName & " " & $sFileName & " " & $iSwitch, _
    "ptr", DllStructGetPtr($tOutBuffer), _
    "int", DllStructGetSize($tOutBuffer))

    If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1))
    Return SetError(1, 0, 0)
    EndFunc ;==>_7ZipDelete

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZIPExtract
    ; Description ...: Extracts files from archive to the current directory or to the output directory
    ; Syntax.........: _7ZIPExtract($hWnd, $sArcName[, $sOutput = 0[, $sHide = 0[, $sOverwrite = 0[, $sRecurse = 1[, _
    ; $sIncludeArc[, $sExcludeArc[, $sIncludeFile = 0[, $sExcludeFile = 0[, $sPassword = 0[, _
    ; $sYes = 0]]]]]]]]]])
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; $sArcName - Archive file name
    ; $sOutput - Output directory
    ; $sHide - Use this switch if you want the CallBack function to be called
    ; $sOverwrite - Overwrite mode: 0 - Overwrite All existing files without prompt, _
    ; 1 - Skip extracting of existing files, _
    ; 2 - Auto rename extracting file, _
    ; 3 - auto rename existing file
    ; $sRecurse - Recursion method: 0 - Disable recursion
    ; 1 - Enable recursion
    ; 2 - Enable recursion only for wildcard names
    ; $sIncludeArc - Include archive filenames
    ; $sExcludeArc - Exclude archive filenames
    ; $sIncludeFile - Include filenames, specifies filenames and wildcards or list file that specify processed files
    ; $sExcludeFile - Exclude filenames, specifies what filenames or (and) wildcards must be excluded from operation
    ; $sPassword - Specifies password
    ; $Yes - assume Yes on all queries
    ; Return values .: Success - Returns the string with results
    ; Failure - Returns 0 and and sets the @error flag to 1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZIPExtract($hWnd, $sArcName, $sOutput = 0, $sHide = 0, $sOverwrite = 0, $sRecurse = 1, $sIncludeArc = 0, $sExcludeArc = 0, _
    $sIncludeFile = 0, $sExcludeFile = 0, $sPassword = 0, $sYes = 0)

    $sArcName = '"' & $sArcName & '"'

    Local $iSwitch = ""

    If $sOutput Then $iSwitch = ' -o"' & $sOutput & '"'
    If $sHide Then $iSwitch &= " -hide"

    $iSwitch &= _OverwriteSet($sOverwrite)
    $iSwitch &= _RecursionSet($sRecurse)

    If $sIncludeArc Then $iSwitch &= _IncludeArcSet($sIncludeArc)
    If $sExcludeArc Then $iSwitch &= _ExcludeArcSet($sExcludeArc)

    If $sIncludeFile Then $iSwitch &= _IncludeFileSet($sIncludeFile)
    If $sExcludeFile Then $iSwitch &= _ExcludeFileSet($sExcludeFile)

    If $sPassword Then $iSwitch &= " -p" & $sPassword
    If $sYes Then $iSwitch &= " -y"

    Local $tOutBuffer = DllStructCreate("char[32768]")

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZip", _
    "hwnd", $hWnd, _
    "str", "e " & $sArcName & " " & $iSwitch, _
    "ptr", DllStructGetPtr($tOutBuffer), _
    "int", DllStructGetSize($tOutBuffer))

    If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1))
    Return SetError(1, 0, 0)
    EndFunc ;==>_7ZIPExtract

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZIPExtractEx
    ; Description ...: Extracts files from archive with full paths to the current directory or to the output directory
    ; Syntax.........: _7ZIPExtract($hWnd, $sArcName[, $sOutput = 0[, $sHide = 0[, $sOverwrite = 0[, $sRecurse = 1[, _
    ; $sIncludeArc[, $sExcludeArc[, $sIncludeFile = 0[, $sExcludeFile = 0[, $sPassword = 0[, _
    ; $sYes = 0]]]]]]]]]])
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; $sArcName - Archive file name
    ; $sOutput - Output directory
    ; $sHide - Use this switch if you want the CallBack function to be called
    ; $sOverwrite - Overwrite mode: 0 - Overwrite All existing files without prompt, _
    ; 1 - Skip extracting of existing files, _
    ; 2 - Auto rename extracting file, _
    ; 3 - auto rename existing file
    ; $sRecurse - Recursion method: 0 - Disable recursion
    ; 1 - Enable recursion
    ; 2 - Enable recursion only for wildcard names
    ; $sIncludeArc - Include archive filenames
    ; $sExcludeArc - Exclude archive filenames
    ; $sIncludeFile - Include filenames, specifies filenames and wildcards or list file that specify processed files
    ; $sExcludeFile - Exclude filenames, specifies what filenames or (and) wildcards must be excluded from operation
    ; $sPassword - Specifies password
    ; $Yes - assume Yes on all queries
    ; Return values .: Success - Returns the string with results
    ; Failure - Returns 0 and and sets the @error flag to 1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipExtractEx($hWnd, $sArcName, $sOutput = 0, $sHide = 0, $sOverwrite = 0, $sRecurse = 1, $sIncludeArc = 0, _
    $sExcludeArc = 0, $sIncludeFile = 0, $sExcludeFile = 0, $sPassword = 0, $sYes = 0)

    $sArcName = '"' & $sArcName & '"'

    Local $iSwitch = ""

    If $sOutput Then $iSwitch = ' -o"' & $sOutput & '"'
    If $sHide Then $iSwitch &= " -hide"

    $iSwitch &= _OverwriteSet($sOverwrite)
    $iSwitch &= _RecursionSet($sRecurse)

    If $sIncludeArc Then $iSwitch &= _IncludeArcSet($sIncludeArc)
    If $sExcludeArc Then $iSwitch &= _ExcludeArcSet($sExcludeArc)

    If $sIncludeFile Then $iSwitch &= _IncludeFileSet($sIncludeFile)
    If $sExcludeFile Then $iSwitch &= _ExcludeFileSet($sExcludeFile)

    If $sPassword Then $iSwitch &= " -p" & $sPassword
    If $sYes Then $iSwitch &= " -y"

    Local $tOutBuffer = DllStructCreate("char[32768]")

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZip", _
    "hwnd", $hWnd, _
    "str", "x " & $sArcName & " " & $iSwitch, _
    "ptr", DllStructGetPtr($tOutBuffer), _
    "int", DllStructGetSize($tOutBuffer))

    If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1))
    Return SetError(1, 0, 0)
    EndFunc ;==>_7ZIPExtractEx

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZIPUpdate
    ; Description ...: Update older files in the archive and add files that are new to the archive
    ; Syntax.........: _7ZIPUpdate($hWnd, $sArcName, $sFileName[, $sHide = 0[, $sCompress = 5[, $sRecurse = 1[, _
    ; $sIncludeFile = 0[, $sExcludeFile = 0[, $sPassword = 0[, $sSFX = 0[, $sWorkDir = 0]]]]]]]])
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; $sArcName - Archive file name
    ; $sFileName - File names to archive up
    ; $sHide - Use this switch if you want the CallBack function to be called
    ; $sCompress - Compress level 0-9
    ; $sRecurse - Recurse method: 0 - Disable recursion
    ; 1 - Enable recursion
    ; 2 - Enable recursion only for wildcard names
    ; $sIncludeFile - Include filenames, specifies filenames and wildcards or list file that specify processed files
    ; $sExcludeFile - Exclude filenames, specifies what filenames or (and) wildcards must be excluded from operation
    ; $sPassword - Specifies password
    ; $sSFX - Creates self extracting archive
    ; $sWorkDir - Sets working directory for temporary base archive
    ; Return values .: Success - Returns the string with results
    ; Failure - Returns 0 and and sets the @error flag to 1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipUpdate($hWnd, $sArcName, $sFileName, $sHide = 0, $sCompress = 5, $sRecurse = 1, $sIncludeFile = 0, $sExcludeFile = 0, _
    $sPassword = 0, $sSFX = 0, $sWorkDir = 0)

    $sArcName = '"' & $sArcName & '"'
    $sFileName = '"' & $sFileName & '"'

    Local $iSwitch = ""

    If $sHide Then $iSwitch &= " -hide"

    $iSwitch = " -mx" & $sCompress
    $iSwitch &= _RecursionSet($sRecurse)

    If $sIncludeFile Then $iSwitch &= _IncludeFileSet($sIncludeFile)
    If $sExcludeFile Then $iSwitch &= _ExcludeFileSet($sExcludeFile)

    If $sPassword Then $iSwitch &= " -p" & $sPassword
    If FileExists($sSFX) Then $iSwitch &= " -sfx" & $sSFX
    If $sWorkDir Then $iSwitch &= " -w" & $sWorkDir

    Local $tOutBuffer = DllStructCreate("char[32768]")

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZip", _
    "hwnd", $hWnd, _
    "str", "u " & $sArcName & " " & $sFileName & " " & $iSwitch, _
    "ptr", DllStructGetPtr($tOutBuffer), _
    "int", DllStructGetSize($tOutBuffer))

    If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1))
    Return SetError(1, 0, 0)
    EndFunc ;==>_7ZIPUpdate

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipSetOwnerWindowEx
    ; Description ...: Appoints the call-back function in order to receive the information of the compressing/unpacking
    ; Syntax.........: _7ZipSetOwnerWindowEx($hWnd, $sProcFunc)
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; $sProcFunc - The call-back function name
    ; Return values .: Success - Returns 1
    ; Failure - Returns 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipSetOwnerWindowEx($hWnd, $sProcFunc)
    If $hArchiveProc Then DllCallbackFree($hArchiveProc)
    $hArchiveProc = DllCallbackRegister($sProcFunc, "int", "hwnd;uint;uint;ptr")
    If $hArchiveProc = 0 Then Return SetError(1, 0, 0)

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipSetOwnerWindowEx", _
    "hwnd", $hWnd, _
    "ptr", DllCallbackGetPtr($hArchiveProc))
    Return $aRet[0]
    EndFunc ;==>_7ZipSetOwnerWindowEx

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipKillOwnerWindowEx
    ; Description ...: Cancels a window owner
    ; Syntax.........: _7ZipKillOwnerWindowEx($hWnd)
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; Return values .: Success - Returns 1
    ; Failure - Returns 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipKillOwnerWindowEx($hWnd)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipKillOwnerWindowEx", _
    "hwnd", $hWnd)
    Return $aRet[0]
    EndFunc ;==>_7ZipKillOwnerWindowEx

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipOpenArchive
    ; Description ...: Opens a arcive file
    ; Syntax.........: _7ZipOpenArchive($sArcName)
    ; Parameters ....: hWnd - Handle to parent or owner window
    ; $sArcName - Archive file name
    ; Return values .: Success - Returns a archive handle
    ; Failure - Returns 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipOpenArchive($hWnd, $sArcName)
    Local $hArc = DllCall($hDLL_7ZIP, "hwnd", "SevenZipOpenArchive", "hwnd", $hWnd, "str", $sArcName, "int", 0)
    Return $hArc[0]
    EndFunc ;==>_7ZipOpenArchive

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipCloseArchive
    ; Description ...: Closes a previously opened archive handle
    ; Syntax.........: _7ZipCloseArchive($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns 0
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipCloseArchive($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipCloseArchive", "hwnd", $hArc)
    Return $aRet[0]
    EndFunc ;==>_7ZipCloseArchive

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipFindFirst
    ; Description ...: Returns a $INDIVIDUALINFO structure with information of the first finded file
    ; Syntax.........: _7ZipFindFirst($hArc, $sSearch)
    ; Parameters ....: $hArc - Archive handle
    ; $sSearch - File search string. (wildcards are supported)
    ; Return values .: Success - Returns a $INDIVIDUALINFO structure
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipFindFirst($hArc, $sSearch)
    Local $INDIVIDUALINFO = DllStructCreate($tagINDIVIDUALINFO)

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipFindFirst", _
    "hwnd", $hArc, _
    "str", $sSearch, _
    "ptr", DllStructGetPtr($INDIVIDUALINFO))
    If $aRet[0] = -1 Then Return $aRet[0]
    Return $INDIVIDUALINFO
    EndFunc ;==>_7ZipFindFirst

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipFindNext
    ; Description ...: Returns a $tINDIVIDUALINFO structure according to a previous call to _7ZipFindFirst
    ; Syntax.........: _7ZipFindNext($hArc, $tINDIVIDUALINFO)
    ; Parameters ....: $hArc - Archive handle
    ; $tINDIVIDUALINFO - The $tINDIVIDUALINFO structure
    ; Return values .: Success - Returns a $INDIVIDUALINFO structure
    ; Failure - Returns 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipFindNext($hArc, $tINDIVIDUALINFO)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipFindNext", _
    "hwnd", $hArc, _
    "ptr", DllStructGetPtr($tINDIVIDUALINFO))
    If $aRet[0] = 0 Then Return $tINDIVIDUALINFO
    EndFunc ;==>SevenZipFindNext

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetFileName
    ; Description ...: Returns a file name
    ; Syntax.........: _7ZipGetFileName($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns a string with a file name
    ; Failure - Returns 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetFileName($hArc)
    Local $tNameBuffer = DllStructCreate("char[" & $FNAME_MAX32 + 1 & "]")

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipGetFileName", _
    "hwnd", $hArc, _
    "ptr", DllStructGetPtr($tNameBuffer), _
    "int", DllStructGetSize($tNameBuffer))
    If $aRet[0] = 0 Then Return DllStructGetData($tNameBuffer, 1)
    EndFunc ;==>_7ZipGetFileName

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetArcOriginalSize
    ; Description ...: Returns a original size of files in an archive
    ; Syntax.........: _7ZipGetArcOriginalSize($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns a total size
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetArcOriginalSize($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipGetArcOriginalSize", _
    "hwnd", $hArc)
    Return $aRet[0]
    EndFunc ;==>_7ZipGetArcOriginalSize

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetArcCompressedSize
    ; Description ...: Returns a compressed size of files in an archive
    ; Syntax.........: _7ZipGetArcCompressedSize($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns a total size
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetArcCompressedSize($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipGetArcCompressedSize", _
    "hwnd", $hArc)
    Return $aRet[0]
    EndFunc ;==>_7ZipGetArcCompressedSize

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetArcRatio
    ; Description ...: Returns a compressing ratio
    ; Syntax.........: _7ZipGetArcRatio($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns a compressing ratio
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetArcRatio($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "short", "SevenZipGetArcRatio", _
    "hwnd", $hArc)
    Return $aRet[0]
    EndFunc ;==>_7ZipGetArcRatio

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetDate
    ; Description ...: Returns a date of files in an archive
    ; Syntax.........: _7ZipGetDate($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns a date in an MSDOS format
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetDate($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "short", "SevenZipGetDate", _
    "hwnd", $hArc)
    If $aRet[0] = -1 Then Return $aRet[0]
    Return "0x" & Hex($aRet[0], 4)
    EndFunc ;==>_7ZipGetDate

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetTime
    ; Description ...: Returns a time of files in an archive
    ; Syntax.........: _7ZipGetTime($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns a time in an MSDOS format
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetTime($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "short", "SevenZipGetTime", _
    "hwnd", $hArc)
    If $aRet[0] = -1 Then Return $aRet[0]
    Return "0x" & Hex($aRet[0], 4)
    EndFunc ;==>_7ZipGetTime

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetCRC
    ; Description ...: Returns a CRC of files in an archive
    ; Syntax.........: _7ZipGetCRC($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns a CRC
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetCRC($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "dword", "SevenZipGetCRC", _
    "hwnd", $hArc)
    Return $aRet[0]
    EndFunc ;==>_7ZipGetCRC

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetAttribute
    ; Description ...: Returns a attribute of files in an archive
    ; Syntax.........: _7ZipGetAttribute($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns attribute of the file
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetAttribute($hArc)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipGetAttribute", _
    "hwnd", $hArc)
    If $aRet[0] = -1 Then Return $aRet[0]
    Return "0x" & Hex($aRet[0], 2)
    EndFunc ;==>_7ZipGetAttribute

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetMethod
    ; Description ...: Returns a string with the method of compressing
    ; Syntax.........: _7ZipGetMethod($hArc)
    ; Parameters ....: $hArc - Archive handle
    ; Return values .: Success - Returns the method of compressing
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetMethod($hArc)
    Local $sBUFFER = DllStructCreate("char[8]")

    [/autoit] [autoit][/autoit] [autoit]

    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipGetMethod", _
    "hwnd", $hArc, _
    "ptr", DllStructGetPtr($sBUFFER), _
    "int", DllStructGetSize($sBUFFER))
    If $aRet[0] <> 0 Then Return False
    Return DllStructGetData($sBUFFER, 1)
    EndFunc ;==>_7ZipGetMethod

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZIPCheckArchive
    ; Description ...: Checks archive files
    ; Syntax.........: _7ZIPCheckArchive($sArcName)
    ; Parameters ....: $sArcName - Archive file name
    ; Return values .: Success - 1
    ; Failure - 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipCheckArchive($sArcName)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipCheckArchive", _
    "str", $sArcName, _
    "int", 0)
    Return $aRet[0]
    EndFunc ;==>_7ZIPCheckArchive

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetArchiveType
    ; Description ...: Returns the archive type
    ; Syntax.........: _7ZipGetArchiveType($sArcName)
    ; Parameters ....: $sArcName - Archive file name
    ; Return values .: Success: 1 - ZIPtype
    ; 2 - 7Ztype
    ; 0 - Unknown type
    ; Failure - -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetArchiveType($sArcName)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipGetArchiveType", _
    "str", $sArcName)
    Return $aRet[0]
    EndFunc ;==>_7ZIPGetArchiveType

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetFileCount
    ; Description ...: Returns the archive files count
    ; Syntax.........: _7ZipGetFileCount($sArcName)
    ; Parameters ....: $sArcName - Archive file name
    ; Return values .: Success - Returns the number of files
    ; Failure - Returns -1
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetFileCount($sArcName)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipGetFileCount", _
    "str", $sArcName)
    Return $aRet[0]
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipConfigDialog
    ; Description ...: Shows a about dialog of the 7-zip32.dll
    ; Syntax.........: SevenZipConfigDialog($hWnd)
    ; Parameters ....: $hWnd - Handle to parent or owner window
    ; Return values .: Success - Returns 1
    ; Failure - Returns 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipConfigDialog($hWnd)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipConfigDialog", _
    "hwnd", $hWnd, _
    "ptr", 0, _
    "int", 0)
    Return $aRet[0]
    EndFunc ;==>SevenZipConfigDialog

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipQueryFunctionList
    ; Description ...: Checks whether or not API function which is appointed with 7-zip32.dll
    ; Syntax.........: _7ZipQueryFunctionList($iFunction)
    ; Parameters ....: $iFunction - The unique numerical value of the function
    ; Return values .: Success - Returns 1
    ; Failure - Returns 0
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipQueryFunctionList($iFunction = 0)
    Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZipQueryFunctionList", _
    "int", $iFunction)
    Return $aRet[0]
    EndFunc ;==>_7ZipQueryFunctionList

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetVersion
    ; Description ...: Returns a version of the 7-zip32.dll
    ; Syntax.........: _7ZipGetVersion()
    ; Parameters ....: None
    ; Return values .: The version number
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetVersion()
    Local $aRet = DllCall($hDLL_7ZIP, "short", "SevenZipGetVersion")
    Return StringLeft($aRet[0], 1) & "." & StringTrimLeft($aRet[0], 1)
    EndFunc ;==>_7ZipGetVersion

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _7ZipGetSubVersion
    ; Description ...: Returns a sub-version of the 7-zip32.dll
    ; Syntax.........: _7ZipGetSubVersion()
    ; Parameters ....: None
    ; Return values .: The sub-version number
    ; Author ........: R. Gilman (rasim)
    ; ===============================================================================================================================
    Func _7ZipGetSubVersion()
    Local $aRet = DllCall($hDLL_7ZIP, "short", "SevenZipGetSubVersion")
    Return $aRet[0]
    EndFunc ;==>_7ZipGetSubVersion

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTIONS FOR INTERNAL USE# ==================================================================================================
    Func _RecursionSet($sVal)
    Switch $sVal
    Case 1
    Return " -r"
    Case 2
    Return " -r0"
    Case Else
    Return " -r-"
    EndSwitch
    EndFunc ;==>_RecursionSet

    [/autoit] [autoit][/autoit] [autoit]

    Func _IncludeFileSet($sVal)
    If StringInStr($sVal, "*") Then
    Return ' -i!"' & $sVal & '"'
    ElseIf StringLeft($sVal, 1) = "@" Then
    Return ' -i"' & $sVal & '"'
    Else
    Return ' -i!"' & $sVal & '"'
    EndIf
    EndFunc ;==>_IncludeFileSet

    [/autoit] [autoit][/autoit] [autoit]

    Func _ExcludeFileSet($sVal)
    If StringInStr($sVal, "*") Then
    Return ' -x!"' & $sVal & '"'
    ElseIf StringLeft($sVal, 1) = "@" Then
    Return ' -x"' & $sVal & '"'
    Else
    Return ' -x!"' & $sVal & '"'
    EndIf
    EndFunc ;==>_ExcludeFileSet

    [/autoit] [autoit][/autoit] [autoit]

    Func _OverwriteSet($sVal)
    Switch $sVal
    Case 0
    Return " -aoa"
    Case 1
    Return " -aos"
    Case 2
    Return " -aou"
    Case 3
    Return " -aot"
    Case Else
    Return " -aoa"
    EndSwitch
    EndFunc ;==>_OverwriteSet

    [/autoit] [autoit][/autoit] [autoit]

    Func _IncludeArcSet($sVal)
    If StringInStr($sVal, "*") Then
    Return ' -ai!"' & $sVal & '"'
    ElseIf StringLeft($sVal, 1) = "@" Then
    Return ' -ai"' & $sVal & '"'
    Else
    Return ' -ai!"' & $sVal & '"'
    EndIf
    EndFunc ;==>_IncludeArcSet

    [/autoit] [autoit][/autoit] [autoit]

    Func _ExcludeArcSet($sVal)
    If StringInStr($sVal, "*") Then
    Return ' -ax!"' & $sVal & '"'
    ElseIf StringLeft($sVal, 1) = "@" Then
    Return ' -ax"' & $sVal & '"'
    Else
    Return ' -ax!"' & $sVal & '"'
    EndIf
    EndFunc ;==>_ExcludeArcSet

    [/autoit] [autoit][/autoit] [autoit]

    Func OnAutoitExit()
    If IsDeclared("hDLL_7ZIP") Then
    DllClose($hDLL_7ZIP)
    If $hArchiveProc Then DllCallbackFree($hArchiveProc)
    EndIf
    EndFunc ;==>OnAutoitExit

    [/autoit]