找回密码
 加入
搜索
查看: 1563|回复: 3

关于_IENavigate 郁闷的问题。

[复制链接]
发表于 2009-9-9 20:41:18 | 显示全部楼层 |阅读模式
本帖最后由 kkikk 于 2009-9-9 21:04 编辑

4个按钮,点一个开始加载网页,但是网页不加载完毕的时候,点其他按钮无效?

具体点就点了b1按钮访问新浪,页面没加载完毕或者网络延时,导致卡死,这时点击b2b3b4和退出都无效了,是处理机制的原因?不知道是否有办法解决?

正好卡在那里网页没加载完,点退出都是等待过了几十秒页面加载完毕,程序才退出,这样的感觉比较恼火。

#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <IE.au3>

_IEErrorHandlerRegister()
$oIE = _IECreateEmbedded()


$WinMain = GUICreate("网页浏览", 720, 570, (@DesktopWidth - 720) / 2, (@DesktopHeight - 600) / 2)
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 720, 500)
$Button1 = GUICtrlCreateButton("b1", 20, 520, 80, 30)
$Button2 = GUICtrlCreateButton("b2", 120, 520, 80, 30)
$Button3 = GUICtrlCreateButton("b3", 220, 520, 80, 30)
$Button4 = GUICtrlCreateButton("b4", 320, 520, 80, 30)
$Button5 = GUICtrlCreateButton("退出", 420, 520, 80, 30)
GUISetState(@SW_SHOW)

While 1
        $Msg = GUIGetMsg()
        Switch $Msg
                Case $Button1
                        _GO("http://www.sina.com.cn")
                Case $Button2
                        _GO("http://www.china.com")
                Case $Button3
                        _GO("http://www.sohu.com")
                Case $Button4
                        _GO("http://www.163.com")
                Case $Button5
                        Exit
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
WEnd

Func _GO($TargetUrl)
        _IENavigate($oIE, $TargetUrl)
EndFunc
 楼主| 发表于 2009-9-9 20:43:39 | 显示全部楼层
能否做到点哪个按钮就访问哪个地址,之前打开的页面没加载完毕就中断它,直接访问新要求访问的页面。没有卡机的感觉就好了……
发表于 2009-9-9 20:58:05 | 显示全部楼层
这就是单线程的弊端~没办法的!不能多线程处理,只能等待单一任务完成,才能继续下面的操作
 楼主| 发表于 2009-9-9 21:04:08 | 显示全部楼层
了解了,非常感谢您的回复。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-5 05:14 , Processed in 0.075648 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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