找回密码
 加入
搜索
查看: 2143|回复: 7

[已解决]如何判断$oIE所对应的进程是否关闭?

[复制链接]
发表于 2009-4-27 22:02:49 | 显示全部楼层 |阅读模式
本帖最后由 passkalilo 于 2009-5-16 22:18 编辑

如下代码:
#include <IE.au3>
$url = "www.baidu.com"
$oIE = _IECreate($url)
Sleep(5000)
_IENavigate($oIE,"www.126.com")
如果在Sleep期间,IE进程终止,那么_IENavigate函数会出错,如何在执行之前检查一下$oIE对应的IE进程是否存在?试过这样ProcessExits($oIE)是不行的。
 楼主| 发表于 2009-4-28 11:06:00 | 显示全部楼层
没人回答,先顶一个
发表于 2009-5-14 09:25:58 | 显示全部楼层
#include <IE.au3>
$url = "www.baidu.com"
$oIE = _IECreate($url)
$hwnd = Hwnd($oIE.hwnd())
Sleep(5000)
if not winexists($hwnd) then exit
_IENavigate($oIE,"www.126.com")
 楼主| 发表于 2009-5-15 19:36:59 | 显示全部楼层
3# liongodmien


十分感谢,这么简单怎么就没想到呢
发表于 2009-6-6 17:00:35 | 显示全部楼层
简单的东西往往大家想不到...
发表于 2009-6-6 17:05:05 | 显示全部楼层
#include
$url = "www.baidu.com"
$oIE = _IECreate($url)
$hwnd = Hwnd($oIE.hwnd())
Sleep(5000)
if not winexists($hwnd) then exit
_IENavigate($oIE,"www.126.com")
liongodmien 发表于 2009-5-14 09:25





#include <IE.au3>
$url = "www.baidu.com"
$oIE = _IECreate($url)
$hwnd = Hwnd($oIE);$oIE.hwnd())不行.
Sleep(5000)
if not winexists($hwnd) then exit
_IENavigate($oIE,"www.126.com")
发表于 2009-8-26 22:59:47 | 显示全部楼层
#include <IE.au3>
$url = "www.baidu.com"
$oIE = _IECreate($url)
$hwnd = Hwnd($oIE.hwnd())
Sleep(5000)
if not winexists($hwnd) then exit
_IENavigate($oIE,"www.126.com")
发表于 2009-8-30 15:12:59 | 显示全部楼层
学习了,其实没事来这个论坛看看还是能 学到好多东西的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-27 21:38 , Processed in 0.077709 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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