找回密码
 加入
搜索
查看: 8111|回复: 12

[相关工具] 参考论坛写的

 火.. [复制链接]
发表于 2009-9-28 22:34:34 | 显示全部楼层 |阅读模式
本帖最后由 lpxx 于 2009-9-29 22:17 编辑

参考论坛写的,像我一样的新手可以参考一下.
主要是可以用于软件安装界面参考.
点击关于可以弹出"版权信息"
搜索论坛改的,所以万一有啥技术问题俺基本是回答不了的.
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("这是主窗口", 449, 251, 192, 124)
$Group1 = GUICtrlCreateGroup("autoit中文论坛", 8, 16, 433, 169)
$Label1 = GUICtrlCreateLabel("AutoIt v3 是用以编写并生成具有 BASIC 语言风格的脚本程序的免费软件, ", 16, 40, 421, 17)
$Label2 = GUICtrlCreateLabel("它被设计用来在Windows GUI(用户界面)中进行自动操作.", 16, 64, 415, 17)
$Label3 = GUICtrlCreateLabel("通过它可以组合使用模拟键击,鼠标移动和窗口/控件操作等来实现自动化任务", 16, 88, 424, 17)
$Label4 = GUICtrlCreateLabel("而这是其它语言所无法做到或尚无可靠方法实现的(比如VBScript和SendKeys)", 16, 112, 423, 17)
$Label5 = GUICtrlCreateLabel("AutoIt 非常小巧,完全运行在所有windows操作系统上", 16, 136, 327, 17)
$Label6 = GUICtrlCreateLabel("并且不需要任何运行库. ", 16, 160, 130, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("退出", 256, 216, 81, 25, $WS_GROUP)
GUICtrlSetTip(-1, "温馨提示:点击按钮将退出")
$Button2 = GUICtrlCreateButton("关于", 360, 216, 73, 25, $WS_GROUP)
GUICtrlSetTip(-1, "温馨提示:点击按钮可以查看版权啥的..")
$Label7 = GUICtrlCreateLabel("现在,autoit是一个支持复杂表达式,自定义函数,循环等的强大脚本软件", 16, 192, 419, 17)
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE, $button1
                        Exit
                Case $button2
                       Button2()
        EndSwitch
WEnd
Func Button2()
$Form3 = GUICreate("这是子窗体", 201, 205, 302, 218)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form3, "int", 3000, "long", 0x00080000)
$Group1 = GUICtrlCreateGroup("", 8, 8, 185, 153)
$Pic1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\horse.ani", -1, 80, 41, 41)
$Label1 = GUICtrlCreateLabel("autoit中文论坛", 40, 80, 118, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("网站:www.autoitx.com", 32, 112, 141, 17)
GUICtrlSetCursor (-1, 0)
GUICtrlSetColor(-1, 0x0000FF)
$Label3 = GUICtrlCreateLabel("这里是版权等等啥的", 32, 136, 144, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button3 = GUICtrlCreateButton("确定(&O)", 56, 168, 73, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
 While 1
                Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE
                                        GUISetState(@SW_ENABLE,$Form1)
                                        GUIDelete($Form3)
                                        ExitLoop
                        Case $Button3
                                    
                                       GUISetState(@SW_ENABLE,$Form1)
                                        GUIDelete($Form3)
                                        ExitLoop
                        Case $Label2
                                        Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe www.autoitx.com") 
                EndSwitch
        WEnd
EndFunc

本帖子中包含更多资源

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

×
发表于 2009-9-28 23:22:16 | 显示全部楼层
支持下, 待发展
发表于 2009-9-29 19:16:50 | 显示全部楼层
很好的例子
发表于 2009-9-29 20:31:20 | 显示全部楼层
这代码写得很好
发表于 2009-12-9 14:57:47 | 显示全部楼层
代码不错
谢谢分享
发表于 2009-12-30 00:16:33 | 显示全部楼层
谢谢楼主,学习了
发表于 2010-1-24 22:53:54 | 显示全部楼层
支持楼主,谢谢分享啊!
发表于 2010-1-28 11:10:41 | 显示全部楼层
哈哈。 很好的东西啊。
发表于 2010-1-30 00:55:34 | 显示全部楼层
做个标记!
发表于 2010-1-30 05:23:46 | 显示全部楼层
本帖最后由 pusofalse 于 2010-1-30 05:25 编辑

的确很好的代码,从变量的命名方法上就可以看得出来,楼主没使用$a、$b、$c这样的变量名称来标记一个控件。如果Button2函数的前部分主体有代码缩进就更好了。当然这只是个人看法,书写代码就应该结构化。
发表于 2011-7-19 00:55:03 | 显示全部楼层
参考一下,学习
发表于 2011-8-25 21:36:09 | 显示全部楼层
还是很不错的噢,,顶起来的












您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-25 12:44 , Processed in 0.079177 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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