找回密码
 加入
搜索
查看: 5884|回复: 8

[系统综合] 我是新手请帮我看看代码,为什么卡在界面不动了呢?

  [复制链接]
发表于 2012-7-27 19:56:22 | 显示全部楼层 |阅读模式
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
Opt("TrayiconDebug", 1)
Opt("WinDetectHiddenText", 1)

#Region ### START Koda GUI section ### Form=



FileInstall("1.jpg",@TempDir & "\1.jpg");打包图片,编译图片(图片资源必须与脚本在同一文件夹内)
Dim $dll
$hwnd = GUICreate("完美XP优化程序",800, 600, 310, 100) ;无边框
$Pic1 = GUICtrlCreatePic(@TempDir &"\1.jpg",0,0,800,600);图片
$Progress1 = GUICtrlCreateProgress(126,490, 550, 25)

DllCall("user32.dll", "int", "完美XP优化程序", "hwnd", $hwnd, "int", 500, "long", 0x00080000)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUICtrlSetData(-1, 20)
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###


While 1
       
        
       Sleep(1000)      
                      
 
       
WEnd
 

Func _exit()

        Exit

EndFunc   

Func inst_main()
        
                 
            run("RUNDLL32 netshell.dll,StartNCW")
        BlockInput(1);屏蔽鼠标键盘
                winwaitactive("新建连接向导","新建连接向导")
        send("!N")
                winwaitactive("新建连接向导","连接到 Internet(&C)")
            send("!N")
            winwaitactive("新建连接向导","从 Internet 服务提供商(ISP)列表选择(&L)")
        send("!M!N")
        winwaitactive("新建连接向导","新建连接向导")
        send("!U!N")
        winwaitactive("新建连接向导","在下面框中输入您的 ISP 的名称")
        send(Eval("宽带连接"))
        send("!N!N")
                winwaitactive("新建连接向导","正在完成新建连接向导")
        send("!S{ENTER}")
If WinActive("网络配置","确定") then
  Send("{ENTER}{esc}")
EndIf
                GUICtrlSetData($Progress1, 10)
        WinWaitClose("新建连接向导","正在完成新建连接向导")
                run("D:\Documents and Settings\Perfect\桌面\优化工具\关闭多余的IDE通道.exe")
        winwaitactive("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
        Send("{ENTER}")
        WinWaitClose ("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
        run("D:\Documents and Settings\Perfect\桌面\优化工具\分辨率设置.exe")
                winwaitactive("分辨率智能设置","显示器智能判断")
            Send("{tab}{tab}{ENTER}")                
        Sleep(5000);暂停5秒                
        Send("{esc}")
                WinWaitClose("分辨率智能设置","显示器智能判断")
        DirRemove("D:\Documents and Settings\Perfect\桌面\优化工具",1 )
        Run(@ComSpec&' /c ping 127.0.0.1 -n 3&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE) 
Exit
        
EndFunc   
Func delfile()
        
                FileDelete(@TempDir & "\1.jpg");删除图片

Exit
EndFunc

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2012-7-27 22:23:38 | 显示全部楼层
回复 1# shiqu623


    你这个主函数貌似不会执行呢?
发表于 2012-7-27 23:26:17 | 显示全部楼层
根据你的代码,停在那里是正常的。无可挑剔!
 楼主| 发表于 2012-7-27 23:27:04 | 显示全部楼层
回复 3# haijie1223


   帮我改正一下好吗?
 楼主| 发表于 2012-7-27 23:28:01 | 显示全部楼层
回复 3# haijie1223


    应该怎才能执行呢?
发表于 2012-7-28 06:51:28 | 显示全部楼层
本帖最后由 scum 于 2012-7-28 06:53 编辑

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
Opt("TrayiconDebug", 1)
Opt("WinDetectHiddenText", 1)

#Region ### START Koda GUI section ### Form=



FileInstall("1.jpg",@TempDir & "\1.jpg");打包图片,编译图片(图片资源必须与脚本在同一文件夹内)
Dim $dll
$hwnd = GUICreate("完美XP优化程序",800, 600, 310, 100) ;无边框
$Pic1 = GUICtrlCreatePic(@TempDir &"\1.jpg",0,0,800,600);图片
$Progress1 = GUICtrlCreateProgress(126,490, 550, 25)

DllCall("user32.dll", "int", "完美XP优化程序", "hwnd", $hwnd, "int", 500, "long", 0x00080000)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUICtrlSetData(-1, 20)
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###


inst_main()
delfile()
_exit()



While 1
       
        
       Sleep(1000)      
                      

       
WEnd


Func _exit()

        Exit

EndFunc   

Func inst_main()
        
                 
            run("RUNDLL32 netshell.dll,StartNCW")
        BlockInput(1);屏蔽鼠标键盘
                winwaitactive("新建连接向导","新建连接向导")
        send("!N")
                winwaitactive("新建连接向导","连接到 Internet(&C)")
            send("!N")
            winwaitactive("新建连接向导","从 Internet 服务提供商(ISP)列表选择(&L)")
        send("!M!N")
        winwaitactive("新建连接向导","新建连接向导")
        send("!U!N")
        winwaitactive("新建连接向导","在下面框中输入您的 ISP 的名称")
        send(Eval("宽带连接"))
        send("!N!N")
                winwaitactive("新建连接向导","正在完成新建连接向导")
        send("!S{ENTER}")
If WinActive("网络配置","确定") then
  Send("{ENTER}{esc}")
EndIf
                GUICtrlSetData($Progress1, 10)
        WinWaitClose("新建连接向导","正在完成新建连接向导")
                run("D:\Documents and Settings\Perfect\桌面\优化工具\关闭多余的IDE通道.exe")
        winwaitactive("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
        Send("{ENTER}")
        WinWaitClose ("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
        run("D:\Documents and Settings\Perfect\桌面\优化工具\分辨率设置.exe")
                winwaitactive("分辨率智能设置","显示器智能判断")
            Send("{tab}{tab}{ENTER}")                
        Sleep(5000);暂停5秒                
        Send("{esc}")
                WinWaitClose("分辨率智能设置","显示器智能判断")
        DirRemove("D:\Documents and Settings\Perfect\桌面\优化工具",1 )
        Run(@ComSpec&' /c ping 127.0.0.1 -n 3&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE) 
Exit
        
EndFunc   
Func delfile()
        
                FileDelete(@TempDir & "\1.jpg");删除图片

Exit
EndFunc
 楼主| 发表于 2012-7-28 09:07:27 | 显示全部楼层
回复 6# scum


    非常感谢,我爱关注新手的人
发表于 2012-8-3 15:23:49 | 显示全部楼层
虽然看不懂留着以后学习了
发表于 2012-8-3 22:27:43 | 显示全部楼层
我来帮你看看代码?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 11:48 , Processed in 0.079341 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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