#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