Private Sub Command1_Click()
Dim wzipexe As String ' winzip 执行文件的位置
Dim wsource As String ' 原始文件 (压缩前)
Dim wtarget As String ' 目地文件 (压缩后)
Dim wcmd As String ' Shell 指令
Dim retval As Double ' Shell 指令传回值
Public Declare Function CompFile Lib "FSZLib" (ByVal OutputName As String, ByVal InputName As String, ByVal Level As Long, ByVal ProgressFunction As Long) As Long
Public Declare Function DecompFile Lib "FSZLib" (ByVal OutputName As String, ByVal InputName As String, ByVal ProgressFunction As Long) As Long
Global gPerCent As Integer
Enum fsCompressionLevel
fsCmpNoCompression
fsCmpFastest
fsCmpLev2 '选择压缩比
fsCmpLev3
fsCmpLev4
fsCmpLev5
fsCmpDefault
fsCmpLev7
fsCmpLev8
fsCmpMaximum
End Enum
Public Function 压缩(OutputFile As String, InputFile As String, Level As fsCompressionLevel) As Integer
压缩 = CompFile(OutputFile, InputFile, Level, AddressOf Progress)
End Function
Public Function 解压(OutputFile As String, InputFile As String) As Integer
解压 = DecompFile(OutputFile, InputFile, AddressOf Progress)
End Function