点网页确认按钮

admin2021-01-22  106

import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add()
/*}}*/

import web.form
var wb = web.form(winform)
wb.showMsg=function(text/*信息*/,caption/*标题*/){
    closeDlg_t = function(title) {
        import winex;
        var hwnd, hctr =   winex.waitActive(title, ,"#32770","Button");   
        winex.click(hctr); 
    }
    thread.create(closeDlg_t, caption/*传递参数给线程*/ )
    return true; /*返回false则不显示对话框*/
}   

//打开目标网站
wb.html = /**
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <style type="text/css">
    html,body{ height:100%; margin:0; } 
    </style>
    <script type="text/javascript"></script>
</head>
<body>
<body>
<p>点击按钮,显示确认框。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction(){
    var x;
    var r = confirm("按下按钮!");
    if (r == true){
        x = "你按下了\"确定\"按钮!";
    }
    else{
        x = "你按下了\"取消\"按钮!";
    }
    document.getElementById("demo").innerHTML=x;
}
</script>
</body>
</html>
**/

winform.show();
win.loopMessage();

 

转载请注明原文地址: http://www.aardio.net/read-141.html
最新回复(0)