转自莫愁
/*自动关闭网页弹窗{{*/
autoCloseWebMsgBox = function(){
import thread;
thread.create(
function(){
import winex;
import winex.key;
import io;
var hwnd,ctrl;
while(true){
hwnd,ctrl = winex.findExists("来自网页的消息","确定");
if(ctrl){
winex.click(ctrl);
}
hwnd = winex.find("#32770");
if(hwnd){
winex.key.click(hwnd,"y" );
}
hwnd,ctrl = winex.findExists(".*","允许访问", "#32770");
if(ctrl){
winex.click(ctrl);
}
hwnd,ctrl = winex.findExists(".*","离开", "#32770");
if(ctrl){
winex.click(ctrl);
}
hwnd,ctrl = winex.findExists(".*","是.*Y", "#32770");
if(hwnd){
winex.click(ctrl);
}
hwnd,ctrl = winex.findExists("Windows 安全警告","是");
if(ctrl){
winex.click(ctrl);
}
hwnd,ctrl = winex.findExists("Web 浏览器","重试");
if(ctrl){
winex.click(ctrl);
}
hwnd,ctrl = winex.findExists(".*","不安装", "#32770");
if(ctrl){
winex.click(ctrl);
}
sleep(500);
}
}
)
}
autoCloseWebMsgBox();
/*}}*/
发表评论