【问题标题】:How to bypass BlockInput function (winuser.h)如何绕过 BlockInput 函数 (winuser.h)
【发布时间】:2022-04-12 02:45:15
【问题描述】:

一个应用程序如何在另一个应用程序执行function BlockInput (winuser.h)时接收来自用户的输入

How can I block keyboard and mouse input in C#?

我知道一种方法是 Ctrl + alt + dell ,但除此之外还有其他方法可以让我的应用程序忽略其他应用程序表单的 BlockInput 函数。

我想看看autohotkey or c#的示例代码

编辑:

例如我是running an A.exe 应用程序 和A.exe blockInput 所以我的 ahk 脚本无法接收按键。 我仍然想运行 A.exe 应用程序,但我的 ahk 脚本仍然可以接收按键。

【问题讨论】:

    标签: c# autohotkey


    【解决方案1】:

    按 F1 切换记事本中的 BlockInput(自动热键):

    F1::
        SetTimer, BlockInput_in_notepad, 500
    Return 
    
    BlockInput_in_notepad:
        BlockInput_in_notepad := true
        CoordMode, ToolTip, Screen
        ToolTip, BlockInput in notepad is On`n Press F1 to Unblock, 0, 0, 1
        If WinActive("ahk_exe notepad.exe")
            BlockInput On
    return
    
    #If (BlockInput_in_notepad)
    
        F1::
            SetTimer, BlockInput_in_notepad, off
            BlockInput_in_notepad := false
            BlockInput Off
            ToolTip,,,, 1
        return
    
    #If 
    

    【讨论】:

    • 抱歉,我的意思是...我想绕过另一个应用程序的 blockInput,而不是我的应用程序的
    • 例如,我正在运行 A.exe 应用程序和 A.exe blockInput,因此我的 ahk 脚本无法接收按键。我仍然想运行 A.exe 应用程序,但我的 ahk 脚本仍然可以接收按键。
    猜你喜欢
    • 2020-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-04
    • 1970-01-01
    • 2020-05-31
    相关资源
    最近更新 更多