找回密码
 加入
搜索
查看: 1865|回复: 5

[AU3基础] 热键一样,通过au3热键放行程序的热键.

  [复制链接]
发表于 2011-7-26 19:27:39 | 显示全部楼层 |阅读模式
定义AU3  alt+t 热键,要启动的程序也是Alt+t热键弹出的,现在怎样通过au3热键设置密码才能放行程序的热键呢?
发表于 2011-7-26 19:45:23 | 显示全部楼层
回复 1# 0758

把你定义的AU3的 alt+t 热键,改掉不行吗?
 楼主| 发表于 2011-7-27 13:38:38 | 显示全部楼层
不行的,我就是用AU3保护程序的热键
发表于 2011-7-27 23:35:11 | 显示全部楼层



If StringInStr($CmdLineRaw, "/OK") Then  

        Call("un_HotKey")

EndIf




HotKeySet("!t",   , "aaaa")


#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 260, 105, 192, 124)
$Button1 = GUICtrlCreateButton("OK", 88, 48, 75, 25)
$Input1 = GUICtrlCreateInput("输入密码", 72, 8, 113, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        Case $Button1
                        $pass=GUICtrlRead($Input1)
                        if $pass="123456"  Then
                                MsgBox(0,0,"密码正确   程序热键不拦截")
                                Run(@ScriptFullPath & "  /OK")
                                exit
                        Else
                                MsgBox(0,0,"密码错误")
                                EndIf


        EndSwitch
WEnd









Func aaaa ()
        MsgBox(0,0,"程序热键被拦截")
EndFunc


Func un_HotKey ()

 $ver=1
Do 
        
  Sleep(10)        
Until  $ver=2

EndFunc






把上面代码编译之后试试看
 楼主| 发表于 2011-7-28 22:20:01 | 显示全部楼层
非常感谢楼上的代码,经过测试,热键还是不能恢复,
发表于 2011-7-30 11:19:11 | 显示全部楼层
Call("un_HotKey")
??
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 02:32 , Processed in 0.083437 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表