文件压缩 autoit
除了调用winrar,autoit有可以专门压缩文件的函数或者udf吗?如果有的话,能告诉我嘛? #include <WinAPIEx.au3>
_WinAPI_CompressBuffer 回复 2# pusofalse
有例子吗?麻烦给我看看 回复 3# ljxu
帮助文件UDFs3CHS.chm中有示例,P版都把函数给您 指出来了啊、 回复 4# 楼上风云
查看过,没找到,是最近更新的函数吗? v3.3.8.1下的Autoit UDFs Help查過,無此函數 會錯意了!
#include <WinAPIEx.au3>
_WinAPI_CompressBuffer
WinAPIex.au3 Func _WinAPI_CompressBuffer($pUncompressedBuffer, $iUncompressedSize, $pCompressedBuffer, $iCompressedSize, $iFormatAndEngine = 0x0002)
Local $Ret, $pWorkSpace = 0, $Error = 1
Do
$Ret = DllCall('ntdll.dll', 'uint', 'RtlGetCompressionWorkSpaceSize', 'ushort', $iFormatAndEngine, 'ulong*', 0, 'ulong*', 0)
If (@error) Or ($Ret) Then
ExitLoop
EndIf
$pWorkSpace = __HeapAlloc($Ret)
If @error Then
ExitLoop
EndIf
$Ret = DllCall('ntdll.dll', 'uint', 'RtlCompressBuffer', 'ushort', $iFormatAndEngine, 'ptr', $pUncompressedBuffer, 'ulong', $iUncompressedSize, 'ptr', $pCompressedBuffer, 'ulong', $iCompressedSize, 'ulong', 4096, 'ulong*', 0, 'ptr', $pWorkSpace)
If (@error) Or ($Ret) Or (Not $Ret) Then
ExitLoop
EndIf
$Error = 0
Until 1
__HeapFree($pWorkSpace)
If $Error Then
If IsArray($Ret) Then
Return SetError(1, $Ret, 0)
Else
Return SetError(9, 0, 0)
EndIf
EndIf
Return $Ret
EndFunc ;==>_WinAPI_CompressBuffer {:face (125):}
路过学习了先
页:
[1]