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

[GUI管理] 第一次写脚本,程序不能连续运行,请高人指点(已解决)

  [复制链接]
发表于 2012-6-22 20:19:31 | 显示全部楼层 |阅读模式
本帖最后由 简单栽培 于 2012-6-22 21:37 编辑

程序为什么运行一次或几次之后就无法运行了,必须退出之后才能运行。另我想小程序一直浮于窗口的最前,不被其他打开的程序覆盖。程序中不知缺少什么代码,请高手指点一下,万分感谢!代码如下:
#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("测试", 450, 60, 520, 1 )  
$Button1 = GUICtrlCreateButton("123开始", 10, 10, 100, 40, 0)
$Button2 = GUICtrlCreateButton("新浪", 120, 10, 100, 40, 0)
$Button3 = GUICtrlCreateButton("汽车", 230, 10, 100, 40, 0)
$Button4 = GUICtrlCreateButton("好网", 340, 10, 100, 40, 0)
GUISetState(@SW_SHOW)

FUNC _my_ffs ()
        $oIE = _IECreate("http://www.hao123.com/", 1, 1, 1, 1)
       
ENDFUNC        

While 1
        $nMsg = GUIGetMsg()
        Select
                Case  $nMsg = $Button1   
                        WinActivate (_my_ffs ())
                                               
                Case  $nMsg = $Button2
                        $oIE = _IECreate("http://www.sina.com.cn/", 1, 1, 1, 1)
                       
        Case  $nMsg = $Button3                       
                        $oIE = _IECreate("http://www.autohome.com.cn/", 1, 1, 1, 1)
               
                Case  $nMsg = $Button4       
                        WinActivate (_my_ffs ())
                       
EndSelect
WEnd
发表于 2012-6-22 20:43:32 | 显示全部楼层
我的3.3.9.5IE出问题
发表于 2012-6-22 20:59:24 | 显示全部楼层
楼主看看这个   点击这里  和  点击这里2
发表于 2012-6-22 21:11:26 | 显示全部楼层
回复 1# 简单栽培


    新手嘛,还是回复下

#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>

Global Const $SC_MOVE = 0xF010

$Form1 = GUICreate("测试", 450, 60, 520, 1, BitOR($WS_SYSMENU, $WS_POPUP))
$Button1 = GUICtrlCreateButton("123开始", 10, 10, 100, 40, 0)
$Button2 = GUICtrlCreateButton("新浪", 120, 10, 100, 40, 0)
$Button3 = GUICtrlCreateButton("汽车", 230, 10, 100, 40, 0)
$Button4 = GUICtrlCreateButton("好网", 340, 10, 100, 40, 0)
GUISetState(@SW_SHOW)

Func _my_ffs()
        $oIE = _IECreate("http://www.hao123.com/", 1, 1, 0)

EndFunc   ;==>_my_ffs

While 1
        $nMsg = GUIGetMsg()
        Select
                Case $nMsg = $Button1
                        WinActivate(_my_ffs())

                Case $nMsg = $Button2
                        $oIE = _IECreate("http://www.sina.com.cn/", 1, 1, 0)

                Case $nMsg = $Button3
                        $oIE = _IECreate("http://www.autohome.com.cn/", 1, 1, 0)
                Case $nMsg = $Button4
                        WinActivate(_my_ffs())
                Case $nMsg = $GUI_EVENT_CLOSE
                        ExitLoop
                Case $nMsg = $GUI_EVENT_PRIMARYDOWN
                        _SendMessage($Form1, $WM_SYSCOMMAND, $SC_MOVE + $HTCAPTION, 0)
                        

        EndSelect
WEnd
发表于 2012-6-22 21:14:54 | 显示全部楼层
$Form1 = GUICreate("测试", 450, 60, 520, 1)
$Button1 = GUICtrlCreateButton("123开始", 10, 10, 100, 40, 0)
$Button2 = GUICtrlCreateButton("新浪", 120, 10, 100, 40, 0)
$Button3 = GUICtrlCreateButton("汽车", 230, 10, 100, 40, 0)
$Button4 = GUICtrlCreateButton("好网", 340, 10, 100, 40, 0)
GUISetState(@SW_SHOW)
WinSetOnTop($Form1,"",1)

While 1
        $nMsg = GUIGetMsg()
        Select
                Case $nMsg = -3
                        Exit
                Case $nMsg = $Button1
                        ShellExecute("http://www.hao123.com/")
                Case $nMsg = $Button2
                        ShellExecute("http://www.sina.com.cn/")
                Case $nMsg = $Button3
                        ShellExecute("http://www.autohome.com.cn/")
                Case $nMsg = $Button4
                        ShellExecute("http://www.hao123.com/")
        EndSelect
WEnd
 楼主| 发表于 2012-6-22 21:32:24 | 显示全部楼层

RE: 第一次写脚本,程序不能连续运行,请高人指点

回复 3# zerobin


    谢谢指点!!!!!!!
 楼主| 发表于 2012-6-22 21:32:52 | 显示全部楼层
回复 4# happytc


    谢谢指点!!!!
 楼主| 发表于 2012-6-22 21:33:52 | 显示全部楼层
回复 5# haijie1223


    谢谢指点!!!!!!!!!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-30 07:15 , Processed in 0.110388 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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