终于在搜索论坛的帖子中间找到了答案,原来答案就在HELP文件里面,搜索_IEAction,然后里面有2个例子,看第二个例子,代码如下:#include <IE.au3>
$oIE = _IE_Example ("form")
$oSubmit = _IEGetObjByName ($oIE, "submitExample")
$hwnd = _IEPropertyGet($oIE, "hwnd")
_IEAction ($oSubmit, "focus")
ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
; Wait for Alert window, then click on OK
WinWait("Windows Internet Explorer", "ExampleFormSubmitted")
ControlClick("Windows Internet Explorer", "ExampleFormSubmitted", "[CLASS:Button; TEXT:OK; Instance:1;]")
_IELoadWait ($oIE)
以上代码关键语句在
WinWait("Windows Internet Explorer", "ExampleFormSubmitted")
ControlClick("Windows Internet Explorer", "ExampleFormSubmitted", "[CLASS:Button; TEXT:OK; Instance:1;]")
这2句上,第一句意思是确认把弹出的IE对话框处于当前焦点窗口,然后用CONTROLCLICK发送这个窗口的OK按钮一个点击动作。而且根据论坛的经验,好像发送这个点击如果一次不行,需要2次。
经历了这么多天的郁闷和苦恼,终于揭开了难题,原来还是得多看HELP啊、
楼主如果还没解决问题,请联系我QQ45185852,多交流哦 |