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

[AU3基础] 我想实现如下图功能,但又是初学者,求解

    [复制链接]
发表于 2012-1-16 08:47:08 | 显示全部楼层 |阅读模式
本帖最后由 Chinacat 于 2012-1-16 08:49 编辑


我要完成如图所示的功能,自己点击优化模式,然后点击确定优化按钮响应。
因为是刚学,不知如何运行,求解?
#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>


Opt("GUIOnEventMode", 1)
Dim $dll
FileInstall("SkinCrafterDll.dll", @TempDir & "SkinCrafterDll.dll", 1)
FileInstall("vista.skf", @TempDir & "vista.skf", 1)
FileInstall("img0.bmp", @TempDir & "img0.bmp", 1)

#region ### START Koda GUI section ### Form=d:\works\autoit3\other\winsows工具包\windows 工具包.kxf
$Form1 = GUICreate("Windows 系统设置", 401, 301, 377, 240)
Dim $_Skin = @TempDir & "vista.skf"
_SkinGUI(@TempDir & "SkinCrafterDll.dll", $_Skin, $Form1)

GUISetIcon("D:\Works\AutoIt3\Other\Winsows工具包\setting.ico", -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$Pic1 = GUICtrlCreatePic("D:\Works\PS\002\img0.bmp", 0, 0, 400, 40)
GUICtrlSetOnEvent($Pic1, "Pic1Click")
$Group1 = GUICtrlCreateGroup("选项框", 5, 41, 391, 163, -1, $WS_EX_TRANSPARENT)
$Checkbox1 = GUICtrlCreateCheckbox("提升上网速度", 16, 59, 113, 17)
GUICtrlSetOnEvent($Checkbox1, "Checkbox1Click")
$Checkbox2 = GUICtrlCreateCheckbox("为开关机提速", 16, 83, 113, 17)
GUICtrlSetOnEvent($Checkbox2, "Checkbox2Click")
$Checkbox3 = GUICtrlCreateCheckbox("菜单显示提速", 16, 107, 113, 17)
GUICtrlSetOnEvent($Checkbox3, "Checkbox3Click")
$Checkbox4 = GUICtrlCreateCheckbox("窗口显示提速", 16, 131, 113, 17)
GUICtrlSetOnEvent($Checkbox4, "Checkbox4Click")
$Checkbox5 = GUICtrlCreateCheckbox("加快局域网访问", 16, 155, 113, 17)
GUICtrlSetOnEvent($Checkbox5, "Checkbox5Click")
$Checkbox6 = GUICtrlCreateCheckbox("关闭系统共享", 16, 179, 113, 17)
GUICtrlSetOnEvent($Checkbox6, "Checkbox6Click")
$Checkbox7 = GUICtrlCreateCheckbox("关闭光盘自动运行", 136, 59, 121, 17)
GUICtrlSetOnEvent($Checkbox7, "Checkbox7Click")
$Checkbox8 = GUICtrlCreateCheckbox("关闭系统文件保护", 136, 83, 121, 17)
GUICtrlSetOnEvent($Checkbox8, "Checkbox8Click")
$Checkbox9 = GUICtrlCreateCheckbox("默认软件安装D盘", 136, 107, 121, 17)
GUICtrlSetOnEvent($Checkbox9, "Checkbox9Click")
$Checkbox10 = GUICtrlCreateCheckbox("禁用系统还原", 136, 131, 121, 17)
GUICtrlSetOnEvent($Checkbox10, "Checkbox10Click")
$Checkbox11 = GUICtrlCreateCheckbox("禁用系统热键", 136, 155, 121, 17)
GUICtrlSetOnEvent($Checkbox11, "Checkbox11Click")
$Checkbox12 = GUICtrlCreateCheckbox("禁止远程修改注册表", 136, 179, 129, 17)
GUICtrlSetOnEvent($Checkbox12, "Checkbox12Click")
$Checkbox13 = GUICtrlCreateCheckbox("开启IE下载功能", 272, 59, 113, 17)
GUICtrlSetOnEvent($Checkbox13, "Checkbox13Click")
$Checkbox14 = GUICtrlCreateCheckbox("开启多线程下载", 272, 82, 113, 17)
GUICtrlSetOnEvent($Checkbox14, "Checkbox14Click")
$Checkbox15 = GUICtrlCreateCheckbox("开启硬件优化", 272, 106, 113, 17)
GUICtrlSetOnEvent($Checkbox15, "Checkbox15Click")
$Checkbox16 = GUICtrlCreateCheckbox("不加载多余DLL", 272, 129, 121, 17)
GUICtrlSetOnEvent($Checkbox16, "Checkbox16Click")
$Checkbox17 = GUICtrlCreateCheckbox("修复EXE文件关联", 272, 153, 121, 17)
GUICtrlSetOnEvent($Checkbox17, "Checkbox17Click")
$Checkbox18 = GUICtrlCreateCheckbox("取消快捷方式箭头", 272, 176, 121, 17)
GUICtrlSetOnEvent($Checkbox18, "Checkbox18Click")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("优化方式", 5, 206, 391, 40, -1, $WS_EX_TRANSPARENT)
$Radio1 = GUICtrlCreateRadio("Windows XP 模式", 16, 220, 113, 17)
GUICtrlSetOnEvent($Radio1, "Radio1Click")
$Radio2 = GUICtrlCreateRadio("Windows 7 模式", 144, 220, 113, 17)
GUICtrlSetOnEvent($Radio2, "Radio2Click")
$Button1 = GUICtrlCreateButton("确定优化", 288, 217, 75, 25)
GUICtrlSetOnEvent($Button1, "Button1Click")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("版权Chinacat所有,如需了解更多作品,请关注方砖工作室", 37, 278, 326, 17, $SS_CENTER)
GUICtrlSetOnEvent($Label1, "Label1Click")
$Date1 = GUICtrlCreateDate("2012/01/14 12:17:11", 208, 248, 186, 21, -1, 0)
GUICtrlSetOnEvent($Date1, "Date1Change")
$Button2 = GUICtrlCreateButton("屏蔽广告", 8, 248, 75, 21)
GUICtrlSetOnEvent($Button2, "Button2Click")
$Button3 = GUICtrlCreateButton("访问我们", 108, 248, 75, 21)
GUICtrlSetOnEvent($Button3, "Button3Click")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
        $_msg = GUIGetMsg()
        Switch $_msg
                
                Case $GUI_EVENT_CLOSE
                        Quit()
                        
                Case $Button1
                        
                Case $Button2
                        
                Case $Button3
                        _IECreate("http://www.google.cn/")

        EndSwitch

WEnd

Func Button1Click()

EndFunc   ;==>Button1Click
Func Button2Click()

EndFunc   ;==>Button2Click
Func Button3Click()

EndFunc   ;==>Button3Click
Func Checkbox10Click()

EndFunc   ;==>Checkbox10Click
Func Checkbox11Click()

EndFunc   ;==>Checkbox11Click
Func Checkbox12Click()

EndFunc   ;==>Checkbox12Click
Func Checkbox13Click()

EndFunc   ;==>Checkbox13Click
Func Checkbox14Click()

EndFunc   ;==>Checkbox14Click
Func Checkbox15Click()

EndFunc   ;==>Checkbox15Click
Func Checkbox16Click()

EndFunc   ;==>Checkbox16Click
Func Checkbox17Click()

EndFunc   ;==>Checkbox17Click
Func Checkbox18Click()

EndFunc   ;==>Checkbox18Click
Func Checkbox1Click()

EndFunc   ;==>Checkbox1Click
Func Checkbox2Click()

EndFunc   ;==>Checkbox2Click
Func Checkbox3Click()

EndFunc   ;==>Checkbox3Click
Func Checkbox4Click()

EndFunc   ;==>Checkbox4Click
Func Checkbox5Click()

EndFunc   ;==>Checkbox5Click
Func Checkbox6Click()

EndFunc   ;==>Checkbox6Click
Func Checkbox7Click()

EndFunc   ;==>Checkbox7Click
Func Checkbox8Click()

EndFunc   ;==>Checkbox8Click
Func Checkbox9Click()

EndFunc   ;==>Checkbox9Click
Func Date1Change()

EndFunc   ;==>Date1Change
Func Form1Close()
        Quit()

EndFunc   ;==>Form1Close
Func Form1Maximize()
        ;$DISABLE()

EndFunc   ;==>Form1Maximize
Func Form1Minimize()

EndFunc   ;==>Form1Minimize
Func Form1Restore()

EndFunc   ;==>Form1Restore
Func Label1Click()

EndFunc   ;==>Label1Click
Func Pic1Click()

EndFunc   ;==>Pic1Click
Func Radio1Click()

EndFunc   ;==>Radio1Click
Func Radio2Click()

EndFunc   ;==>Radio2Click


Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
        $dll = DllOpen($SkincrafterDll)
        DllCall($dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
        DllCall($dll, "int:cdecl", "InitDecoration", "int", 1)
        DllCall($dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
        DllCall($dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
        DllCall($dll, "int:cdecl", "ApplySkin")
EndFunc   ;==>_SkinGUI



Func Quit()
        GUISetState(@SW_HIDE)
        DllCall($dll, "int:cdecl", "DeInitDecoration")
        DllCall($dll, "int:cdecl", "RemoveSkin")
        DllClose($dll)
        FileDelete(@TempDir & "SkinCrafterDll.dll")
        FileDelete(@TempDir & "vista.skf")
        FileDelete(@TempDir & "img0.bmp")
        ;DirRemove(@AppDataDir&"\skin",1)
        Exit
EndFunc   ;==>Quit

本帖子中包含更多资源

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

×
发表于 2012-1-16 09:17:23 | 显示全部楼层
好好看看帮助了,好久没有玩这个了。
发表于 2012-1-16 09:20:06 | 显示全部楼层
帮助里有的不全面啊
 楼主| 发表于 2012-1-16 09:24:42 | 显示全部楼层
回复 2# redapple2008
好吧,我自个回去看帮助算了,看来还是“帮助”帮助我。。。
发表于 2012-1-16 10:20:06 | 显示全部楼层
我觉得这个谁多不怎么好帮你
看代码基本的多有了
功能是只能自己加的,如果别人帮了,那就是别人做的了
你做的界面只是为了看的,每个人做的界面可以不一样,但实在的功能是一样的
程序的关键是功能,功能是任何书中讲的最少的
发表于 2012-1-16 10:22:21 | 显示全部楼层
控件很整齐
发表于 2012-1-16 10:25:46 | 显示全部楼层
回复  redapple2008
好吧,我自个回去看帮助算了,看来还是“帮助”帮助我。。。
Chinacat 发表于 2012-1-16 09:24


把你的代码里创建单选或复选框控件并建立响应函数的代码去掉!
去掉所有类似 GUICtrlSetOnEvent($Checkbox4, "Checkbox4Click")...
而在响应按钮点击的函数里加上单选或复选的点击判断,
通过判断结果而决定调用特定的 Checkbox??Click()函数.
这不就达到你的目的了吗?
 楼主| 发表于 2012-1-16 10:34:12 | 显示全部楼层
回复 7# user3000
嗯嗯,明白了,谢谢哈。。。真是好人。。。谢谢各位啦哈
发表于 2012-1-16 10:36:49 | 显示全部楼层
请问各位该主题适合用什么关键字搜索
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-30 01:49 , Processed in 0.075946 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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