代码要整理好,并用标签发帖
问题不少,意思不明,AU3版本函数老旧,粗看粗修
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;#NoTrayIcon
#include <GUIConstantsEx.au3>
;~ #include <ACN_MISC.au3>
#include <Array.au3>
#include <File.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Global $msg, $input1, $combo1, $combo2, $checkbox1, $flag, $num = 5, $hot_key, $toggle = 0, $frequency
test()
Func test()
GUICreate("test", 370, 267)
GUISetBkColor(0x00ffffff)
GUICtrlSetDefColor(0x000000);设置文本默认颜色
GUICtrlCreateLabel("请选择好频率:", 20, 20, 100, 21, 0x0300)
$combo1 = GUICtrlCreateCombo("", 110, 20, 60, 21)
GUICtrlSetData(-1, "5|10", $num)
GUICtrlCreateLabel("开始执行的热键设置:", 20, 80, 120, 21, 0x0300)
$combo2 = GUICtrlCreateCombo("", 140, 80, 60, 21)
GUICtrlSetData(-1, "F2|F3|F4|F5|F6|F7|F8", "F8")
GUICtrlCreateLabel("键", 205, 80, 120, 21, 0x0300)
$checkbox1 = GUICtrlCreateCheckbox("", 20, 50, 20, 20)
GUICtrlCreateLabel("输入自定义的频率为:", 41, 50, 180, 21, 0x0300)
$input1 = GUICtrlCreateInput("4", 160, 50, 50, 20)
GUICtrlCreateLabel("次", 205, 50, 20, 21, 0x0300)
GUICtrlSetColor(-1, 0x000000)
GUISetState()
$hot_key = GUICtrlRead($combo2)
HotKeySet("{" & $hot_key & "}", "toggle")
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $checkbox1
If BitAND(GUICtrlRead($checkbox1), $GUI_CHECKED) Then
GUICtrlSetState($combo1, $GUI_DISABLE)
$num = Number(GUICtrlRead($input1))
Else
GUICtrlSetState($combo1, $GUI_ENABLE)
$num = Number(GUICtrlRead($combo1))
EndIf
Case $combo2
$hot_key = GUICtrlRead($combo2)
HotKeySet("{" & $hot_key & "}", "toggle")
EndSwitch
WEnd
;~ If BitAND(GUICtrlRead($checkbox1), $GUI_CHECKED) Then
;~ $num = Number(GUICtrlRead($input1))
;~ Else
;~ $num = Number(GUICtrlRead($combo1))
;~ EndIf
EndFunc ;==>test
Func start()
If $toggle Then
check($num)
;~ AdlibEnable('start')
EndIf
EndFunc ;==>start
Func toggle()
$toggle = Not $toggle
;~ If $toggle Then AdlibEnable('start', 100)
If $toggle Then AdlibRegister('start', 100)
EndFunc ;==>toggle
Func check($x)
While $x > 0
MsgBox(16, "", $x)
$x = $x - 1
If $x = 0 Or Not $toggle Then ;Exit ;想退出程序的执行,返回主界面,而不是退出程序
;~ AdlibDisable()
AdlibUnRegister()
$toggle = 0
Return
EndIf
WEnd
EndFunc ;==>check
|