锁定输入 公开

CL 更新于 2023-12-04 09:07 | 6 | (1) | 1651
分类
点赞
更多信息
分享人 CL
分享时间 2021-11-24 10:39
最后更新 2023-12-04 09:07
修订版本 1
子程序大小 1.1 KB
Quicker版本 1.40.17.0

介绍

锁定键盘和鼠标输入。必须匹配锁定和解锁,否则后续调用会失效。

锁定键盘和鼠标输入。

尽量避免使用此子程序,仅用于在特定情况下减少键盘鼠标的影响。

【遇到意外情况可以用Ctrl+Alt+Delet 解锁。】

必须匹配锁定和解锁,否则后续调用会失效。】


参考官方文档:

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-blockinput 

根据上述文档,如下情况,会自动解锁:

The system will unblock input in the following cases:

  • The thread that blocked input unexpectedly exits without calling BlockInput with fBlock set to FALSE. In this case, the system cleans up properly and re-enables input. 
  • The user presses CTRL+ALT+DEL or the system invokes the Hard System Error modal message box (for example, when a program faults or a device fails).

因此,如果动作结束了,会自动解锁。如果不希望解锁,就在动作中加入足够长的等待时间。

也不能在多线程情况使用次功能,多线程结束了也会自动解锁。


子程序的参数

输入
是否锁定 Boolean
输出

最近更新

修订版本 更新时间 更新说明
1 2023-12-04 09:07 限定到动作线程执行
0 2021-11-24 10:39

最近讨论

BUG反馈 · 94
翱翔 2023-10-05 13:50 CL 2023-10-05 14:09