本帖最后由 KLU3K 于 2009-12-15 13:46 编辑 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("测试程序", 177, 75, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("写入注册表", 8, 8, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("清除注册表", 88, 8, 75, 25)
GUICtrlSetOnEvent(-1, "Button2Click")
$Button3 = GUICtrlCreateButton("测试", 48, 40, 75, 25)
GUICtrlSetOnEvent(-1, "Button3Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Button1Click()
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\11111", "测试", "REG_SZ", "Test")
EndFunc ;==>Button1Click
Func Button2Click()
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\11111")
EndFunc ;==>Button2Click
Func Button3Click()
$1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\11111", "测试")
If $1 = "Test" Then
MsgBox(0, "Debug", "OK")
Else
MsgBox(0, "Debug", "不存在")
EndIf
EndFunc ;==>Button3Click
Func Form1Close()
Exit
EndFunc ;==>Form1Close
|