FileChangeDir(@ScriptDir)
;~ Sleep(10000)
Local $XL_SUCCESS=0
Local $lTaskId = -1
Local $Inited = False
Local $strOpen = "http://down.360safe.com/setup.exe"
Local $strSave = "C:\\360Setup.exe"
Local $strRefr = "http://down.360safe.com/"
$sSave = DllStructCreate("wchar[260]")
$sOpen = DllStructCreate("wchar[260]")
$sRefr = DllStructCreate("wchar[260]")
$lTask = DllStructCreate("long")
DllStructSetData($sSave, 1, $strSave)
DllStructSetData($sOpen, 1, $strOpen)
DllStructSetData($sRefr, 1, $strRefr)
DllStructSetData($lTask, 1, $lTaskId)
If DllCall("XLDownload.dll","long","XLInitDownloadEngine") = 0 Then
MsgBox(16,@ScriptName, "初始化引擎失败.")
Exit
Else
$Inited=True
EndIf
Local $strSaveTD=$strSave&'.td'
If FileExists($strSaveTD) Then
;~ If DllCall("XLDownload.dll","long","XLContinueTaskFromTdFile","ptr",$strSaveTD,"ptr" lTaskId) <> $XL_SUCCESS Then
;~ MsgBox(16,@ScriptName, "继续失败")
;~ Exit
;~ Else
;~ ;继续下载
;~ ;这里While展示进度
;~
;~
;~ EndIf
Else
;~ $result = DllCall("user32.dll", "int", "MessageBox", "hwnd", 0, "str", "若干文字", "str", "若干标题", "int", 64)
;~ Sleep(10000)
Local $result = DllCall("XLDownload.dll","int","XLURLDownloadToFile","ptr",DllStructGetPtr($sSave), "ptr",DllStructGetPtr($sOpen),"ptr",DllStructGetPtr($sRefr),"ptr", DllStructGetPtr($lTask))
Sleep(1000)
MsgBox(16,@ScriptName, $result)
Sleep(100000)
;~ If DllCall("XLDownload.dll","long","XLURLDownloadToFile","str",$strSave, "str",$strOpen,"str","", lTaskId) <> $XL_SUCCESS Then
;~ MsgBox(16,@ScriptName, "添加任务失败")
;~ Else
;~ ;添加成功,已经正在下载,查询下载进度
;~ dwRet = XLQueryTaskInfo(lTaskId, lStatus, ullFileSize, ullRecvSize)
;~ If XL_SUCCESS = dwRet Then
;~ ;'// 输出进度信息
;~ Label1.Caption = "正在下载 " & ullRecvSize & "/" & ullFileSize
;~ Else
;~ Label1.Caption = "查询状态失败"
;~ End If
;~ EndIf
EndIf
只能帮你到这了,我也是AU3新手,不知道怎么传址调用API。。所以上面代码也测试失败下载不了,不过初始化正常了。