介绍
锁定键盘和鼠标输入。必须匹配锁定和解锁,否则后续调用会失效。
锁定键盘和鼠标输入。
尽量避免使用此子程序,仅用于在特定情况下减少键盘鼠标的影响。
【遇到意外情况可以用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).
因此,如果动作结束了,会自动解锁。如果不希望解锁,就在动作中加入足够长的等待时间。
也不能在多线程情况使用次功能,多线程结束了也会自动解锁。
最近更新
修订版本
|
更新时间
|
更新说明
|
0
|
2021-11-24 10:39
|
|
最近讨论
BUG反馈
· 43
翱翔
2023-10-05 13:50
CL
2023-10-05 14:09