本帖最后由 繁星 于 2020-4-4 22:56 编辑 #AutoIt3Wrapper_UseX64=n
Local $Url = 'https://down5.huorong.cn/sysdiag-full-5.0.41.9.exe', _
$FileName = StringMid($Url, StringInStr($Url, '/', Default, -1) + 1)
Global $hXL = DllOpen('xldl.dll')
DllCall($hXL, "bool:cdecl", 'XL_Init')
Local $tagDownTaskParam = 'int nReserved;' & _
'wchar szTaskUrl[2084];' & _
'wchar szRefUrl[2084];' & _
'wchar szCookies[4096];' & _
'wchar szFilename[260];' & _
'wchar szReserved0[260];' & _
'wchar szSavePath[260];' & _
'ptr hReserved;' & _
'bool bReserved;' & _
'wchar szReserved1[64];' & _
'wchar szReserved2[64];' & _
'bool isOnlyOriginal;' & _
'int nReserved1;' & _
'bool DisableAutoRename;' & _
'bool isResume;' & _
'int reserved[2048];'
Local $CreateTask = DllStructCreate($tagDownTaskParam)
DllStructSetData($CreateTask, 'szTaskUrl', $Url)
DllStructSetData($CreateTask, 'szFilename', $FileName)
DllStructSetData($CreateTask, 'szSavePath', @ScriptDir & '\')
;~ DllStructSetData($CreateTask, 'bReserved', 0)
;~ DllStructSetData($CreateTask, 'IsOnlyOriginal', 0)
;~ DllStructSetData($CreateTask, 'nReserved1', 5)
;~ DllStructSetData($CreateTask, 'DisableAutoRename', 0)
;~ DllStructSetData($CreateTask, 'IsResume', 1)
Local $Result = DllCall($hXL, 'hwnd:cdecl', 'XL_CreateTask', 'ptr', DllStructGetPtr($CreateTask))
DllCall($hXL, 'bool:cdecl', 'XL_StartTask', 'hwnd', $Result[0])
While 1
If FileExists(@ScriptDir & '\' & $FileName) Then ExitLoop
WEnd
DllCall($hXL, 'bool:cdecl', 'XL_UnInit')
DllClose($hXL)
|