|
请教一下各位大大,要取消定义的热键,该如何实现?
举个例子
#include <GuiConstants.au3>
#NoTrayIcon
Global $user,$ok1
$begin= GUICreate("选择用户",160, 100)
$combo=GUICtrlCreateCombo("", 30, 10,100,20)
GUICtrlSetData(-1, "user1|user2","user1")
$ok = GUICtrlCreateButton("确定", 50, 70, 60, 20,0)
GUISetState(@SW_SHOW)
while 1
if WinActive("选择用户","")=1 Then
HotKeySet("{Esc}", "_esc")
HotKeySet("{ENTER}", "_ENTER1")
Else
EndIf
$user=GUICtrlRead($combo)
$msg = GUIGetMsg()
Select
Case $msg = $ok
_run($user)
case $msg = $GUI_EVENT_CLOSE
exit
EndSelect
WEnd
Func _run($user)
GUIDelete($begin)
$run= GUICreate("请按确定",160, 100)
$ok1 = GUICtrlCreateButton("确定", 50, 70, 60, 20,0)
GUISetState(@SW_SHOW)
while 1
if WinActive("请按确定","")=1 Then
HotKeySet("{Esc}", "_esc")
HotKeySet("{ENTER}", "_ENTER2")
Else
EndIf
$msg = GUIGetMsg()
Select
Case $msg = $ok1
msgbox(48,"显示","你选择的用户是"&$user)
case $msg = $GUI_EVENT_CLOSE
exit
EndSelect
wend
EndFunc
FUNC _esc()
exit
EndFunc
FUNC _enter1()
$msg=$ok
EndFunc
FUNC _enter2()
EndFunc
在这个脚本里,我想实现,当脚本的窗口激活时,热键生效,脚本窗口非激活时,释放热键...这个该怎么做呢?
[ 本帖最后由 palkiller 于 2008-9-24 09:19 编辑 ] |
|