找回密码
 加入
搜索
查看: 23907|回复: 34

[原创] 我发现我喜欢上了AU3了,学了一个小时做的小工具

 火... [复制链接]
发表于 2013-5-30 18:43:57 | 显示全部楼层 |阅读模式
本帖最后由 wshnz@qq.com 于 2013-5-30 18:53 编辑


新手学了一个小时做的小工具,老鸟别笑,别打击我新手的热情,一个主页修改锁定工具,有源码如下:
#NoTrayIcon
#region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_icon=C:\WINDOWS\system32\SHELL32.dll|-105
#PRE_Outfile=IE主页锁定工具.exe
#PRE_UseUpx=n
#PRE_Res_Comment=一个锁定IE主页的小工具
#PRE_Res_Description=详情QQ258082987
#PRE_Res_Fileversion=1.0.0.0
#PRE_Res_Fileversion_AutoIncrement=p
#PRE_Res_LegalCopyright=掌柜的版权所有 @2012
#PRE_Run_Tidy=y
#PRE_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#endregion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("IE主页锁定工具BY_掌柜的", 385, 103, 192, 133, $WS_SYSMENU)
$Button1 = GUICtrlCreateButton("锁定", 256, 24, 41, 25)
$Label1 = GUICtrlCreateLabel("主页:", 8, 24, 40, 17)
$Input1 = GUICtrlCreateInput("http://www.hao123.com", 56, 24, 193, 21)
$Button2 = GUICtrlCreateButton("解锁", 320, 24, 33, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        Dim $url = GUICtrlRead($Input1)
                        RegWrite("HKEY_CURRENT_USER\Software\Classes\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\OpenHomePage\Command", "", "REG_SZ", '"C:\\Program Files\\Internet Explorer\\iexplore.exe"' & $url)

                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Default_Page_URL", "REG_SZ", $url)
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", $url)
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel", "HomePage", "REG_DWORD", "1")
                        MsgBox(64, "提示", "主页已锁定为:" & $url & "点击确定查看")
                        Run("control inetcpl.cpl")
                Case $Button2
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel", "HomePage", "REG_DWORD", "0")
                        RegWrite("HKEY_CURRENT_USER\Software\Classes\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\OpenHomePage\Command", "", "REG_SZ", '"C:\\Program Files\\Internet Explorer\\iexplore.exe"')
                        RegDelete("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Main", "Start Page")
                        MsgBox(64, "提示", "主页已解除锁定!点击确定可重新设定主页")
                        Run("control inetcpl.cpl")
        EndSwitch
WEnd

评分

参与人数 4金钱 +70 收起 理由
tryhi + 30
xyhqqaa + 10 你缺的是支持
xjdjpbp + 10 支持原創
lpxx + 20

查看全部评分

 楼主| 发表于 2013-5-30 18:48:22 | 显示全部楼层
这是附件[img][/img]

本帖子中包含更多资源

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

×
发表于 2013-5-31 08:16:29 | 显示全部楼层
要钱的? 俺 不要了,我猜楼主应该是改写注册表的!~
发表于 2013-5-31 08:56:49 | 显示全部楼层
支持下拉。。。
发表于 2013-5-31 09:24:34 | 显示全部楼层
本帖最后由 au3x 于 2013-5-31 09:27 编辑

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("主页修改", 329, 114, 384, 339)
$Input1 = GUICtrlCreateInput("http://", 8, 24, 313, 28)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton(" 设为空白页 ", 232, 72, 73, 33)
$Button2 = GUICtrlCreateButton("修改主页", 120, 72, 73, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case  $Button1
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page","REG_SZ","about:blank")
                    MsgBox(0,"","主页已变更为: 空白页")
                Case  $Button2
            Local $input=GUICtrlRead($Input1)
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page","REG_SZ",$input)
                        MsgBox(0,"","主页已变更为:"&$input&" ")
        EndSwitch
WEnd





<<楼主不用搞得那么复杂...如果是一般用户是没权编辑注册表的...》》

本帖子中包含更多资源

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

×
发表于 2013-5-31 15:23:35 | 显示全部楼层
学了一个小时就做出来了,真厉害
发表于 2013-6-1 08:24:19 | 显示全部楼层
我学了半年 写出来的还比不上楼主 , 楼主简直是 神
 楼主| 发表于 2013-6-1 10:18:30 | 显示全部楼层
回复 5# au3x


    你这个锁定了的吗?在IE选项里面能改就没什么实际意义,我的那个是锁定注册表,防止人乱改的,
 楼主| 发表于 2013-6-1 10:19:25 | 显示全部楼层
回复 6# raman


    我有点VB基础,不过你写得很好啊
发表于 2013-6-2 19:37:11 | 显示全部楼层
支持;。学习 学习
发表于 2013-6-3 09:23:01 | 显示全部楼层
赞一个,~~
发表于 2013-6-3 09:34:46 | 显示全部楼层
回复  au3x


    你这个锁定了的吗?在IE选项里面能改就没什么实际意义,我的那个是锁定注册表,防止人乱 ...
wshnz@qq.com 发表于 2013-6-1 10:18



    如果你要在au3实践真理,俺理解 但如果你想用这小小的加锁功能 金山毒霸可以把你的“锁” 无视
发表于 2013-6-4 08:52:58 | 显示全部楼层
回复 13# au3x


估计360也会无视你吧~     人家金山又不是一个人在战斗! 
发表于 2013-6-4 11:44:30 | 显示全部楼层
回复 14# xlj310


    嗯,多谢您的提醒,可我从不用360的产品 也利了au3 截获其进程 一发现立即中断并提示!
发表于 2013-6-4 17:10:01 | 显示全部楼层
不要用于恶意软件啊...
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-26 12:54 , Processed in 0.077840 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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