抱歉,实然发现代码没贴全
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)
Dim $FLAG=0
#include <GUIConstants.au3>
Dim $Button2
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("终结者", 256, 240, 184, 125)
GUISetCursor (2)
GUISetFont(12, 400, 0, "标楷体")
$input1=GUICtrlCreateInput("Winword.EXE", 16, 64, 201, 27)
GUICtrlSetFont(-1, 12, 400, 0, "Cambria")
$Label1 = GUICtrlCreateLabel("请输入需要终结的进程名", 16, 16, 224, 23)
GUICtrlSetFont(-1, 14, 400, 0, "标楷体")
$Label2 = GUICtrlCreateLabel("Ex:WinWord.exe", 16, 40, 72, 19)
GUICtrlSetFont(-1, 10, 400, 0, "Cambria")
$Label3 = GUICtrlCreateLabel("请选择热键组合", 18, 96, 144, 23)
GUICtrlSetFont(-1, 14, 400, 0, "标楷体")
$Label4 = GUICtrlCreateLabel("+", 100, 120, 13, 24)
$Ctrl = GUICtrlCreateCombo("", 16, 120, 73, 25)
GUICtrlSetData(-1,"Ctrl|Alt","Ctrl")
GUICtrlSetFont(-1, 10, 400, 0, "Calibri")
GUICtrlSetCursor (-1, 2)
$input2=GUICtrlCreateInput("S", 120, 120, 97, 23)
GUICtrlSetFont(-1, 10, 400, 0, "Calibri")
$Button1 = GUICtrlCreateButton("启动", 16, 160, 209, 49, 0)
GUICtrlSetFont(-1, 14, 400, 0, "标楷体")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$TMSG=TrayGetMsg ()
Switch $TMSG
Case $TRAY_EVENT_PRIMARYDOUBLE
GUISetState(@SW_SHOW)
EndSwitch
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If $FLAG=0 Then
$Bre=1
$FLAG=1
AdlibEnable("BEGIN")
GUICtrlSetData($Button1,"退出")
GUISetState(@SW_HIDE)
TrayTip("","I am Working Here.",1)
Sleep(500)
Else
Exit
$bre=0
$FLAG=0
AdlibDisable()
GUICtrlSetData($Button1,"启动")
EndIf
EndSwitch
WEnd
Func BEGIN()
$s1=StringLower(GUICtrlRead($input2))
$s2=GUICtrlRead($Ctrl)
Switch $s2
Case "Ctrl"
HotKeySet("^"&$s1,"bre")
Case "Alt"
HotKeySet("!"&$s1,"bre")
EndSwitch
EndFunc
Func bre()
$s=GUICtrlRead($input1)
HotKeySet(@HotKeyPressed)
While ProcessExists($s)
ProcessClose($s)
WEnd
EndFunc |