|
楼主 |
发表于 2018-3-7 21:08:13
|
显示全部楼层
修改后的自定义热键可以执行了,留下给需要的人
#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,$hot_key,$toggle = 0,$frequency
test()
Func test()
;HotKeySet("{F8}","toggle")
GUICreate("test",370,267)
GUISetBkColor (0x00ffffff)
GUICtrlSetDefColor(0x000000);设置文本默认颜色
GuiCtrlCreateLabel ( "请选择好频率:",20, 20, 100, 21,0x0300)
$combo1=GUICtrlCreateCombo("", 110, 20,60,21)
GUICtrlSetData(-1, "10|100|1000","100")
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("50", 160, 50, 50, 20)
GuiCtrlCreateLabel ( "次",205, 50, 20, 21,0x0300)
GUICtrlSetColor(-1, 0x000000)
GUISetState()
$hot_key=GUICtrlRead($combo2)
;MsgBox("","",$hot_key)
HotKeySet("{"&$hot_key&"}","toggle")
While 1
$msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $checkbox1
MsgBox("","",GUICtrlRead($checkbox1,1))
If BitAND(GUICtrlRead($checkbox1),$GUI_CHECKED) Then
GUICtrlSetState($combo1,$GUI_DISABLE)
$num=Number(GUICtrlRead($input1))
Else
GUICtrlSetState($combo1,$GUI_ENABLE)
EndIf
case $combo2
$hot_key=GUICtrlRead($combo2)
HotKeySet("{"&$hot_key&"}","toggle")
EndSwitch
WEnd
EndFunc
Func start()
if $toggle Then
;MouseClick("left")
check()
AdlibEnable('start')
EndIf
EndFunc
Func toggle()
$toggle = Not $toggle ;not 实现开关功能
If $toggle Then AdlibEnable('start', 100)
EndFunc
HotKeySet("{F8}","toggle")
Func check()
$frequency=10
If $frequency>=1 Then
while $frequency>0
MsgBox(16,"",$frequency)
$frequency=$frequency-1
WEnd
EndIf
EndFunc |
|