【求助】用webbrowser无法获取弹出的网页对话框的内容(100)

  • 主题发起人 xuemufang
  • 开始时间
X

xuemufang

Unregistered / Unconfirmed
GUEST, unregistred user!
一:通过webbrowser 控件打开网页:<script type="text/javascript"><!--var theForm = document.forms['form1'];if (!theForm) { theForm = document.form1;}function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); }}// --></script>。。。。。。 <a id="AdLayer" title="不符合条件:1.K013.法人单位16栏产业活动单位数(总数)与实际填报101-2表的单位个数不一致2.K021.法人单位16栏产业活动单位数(其他)与实际填报101-2表的单位个数不一致" href="javascript:__doPostBack('AdLayer','')" style="display:none;visibility :hidden;width:32px;height:32px; position: absolute;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../image/error.png), 0); "></a><script type="text/javascript"><!-- function initAd() { document.all.AdLayer.style.posTop = 0; //设置onLoad事件激发以后,广告层相对于固定后的y方向位置 MoveLayer('AdLayer');//调用函数MoveLayer() document.all.AdLayer.style.visibility = 'visible';//设置层为可见 document.all.AdLayer.style.display='inline'; } function MoveLayer(layerName) { var x = 0;//浮动广告层固定于浏览器的x方向位置 var y = document.body.scrollTop + (document.body.clientHeight-document.all.AdLayer.offsetWidth)/2;//浮动广告层固定于浏览器的y方向位置 eval('document.all.' + layerName + '.style.posTop = y'); eval('document.all.' + layerName + '.style.posright = x');//移动广告层 setTimeout("MoveLayer('AdLayer');", 20);//设置20毫秒后再调用函数MoveLayer() } initAd(); WebForm_InitCallback();WebForm_AutoFocus('ctl20_ctl03_BillTextBox1');// --></script></form></body></html>二,点击"AdLayer" ,跳出ie打开的网页对话框,我想通过webbrowser的onnewwindows2事件无法获取, 不知道为什么,我是想控制这个对话框,在这个对话框中输入文字,然后提交。对话框是动态生成的。
 
拦截对话框需要自己实现webbrowser的相应接口,建议使用embeddedWB, 其中已经封装了两个重要的接口,我以前用过,可以用来拦截弹出框,得到其中的信息,或自行处理使其不显示
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
713
import
I
顶部