Windows下鼠标键盘的禁用与解禁

in #windows6 years ago

有时候需要通过软件来禁用PC的鼠标键盘,等时机成熟了的时候呢再解禁这种限制。实现方法应该有很多种,这个时候最方便的方法就是调用Windows系统API函数User32.dll来实现。
简单配置系统函数如下图。DLL所在的目录默认如下,在C:\Windows\System32\user32.dll,其中的函数BlockInput就可以同时禁用鼠标键盘灯输入设备。配置如下,很简单。

    代码也很简单。输入"1"的时候就是禁用,输入"0"则为解禁。

    到这里,看样子是结束了,但是在实际测试过程中发现有的电脑有效,有的无效。这就对了,还有最后一步,需要将UAC设置为低等级。

Reference
转载自微信公众号:LabVIEW-Jobs
This post is forward from Wechat account: LabVIEW-Jobs
2. 有疑问可以联系[email protected]
Any questions, please query at [email protected] more information click here

Source: http://www.colinzhang.net/2018/04/windows.html

Sort:  

Congratulations @colinzhang! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.28
TRX 0.13
JST 0.032
BTC 61185.89
ETH 2933.50
USDT 1.00
SBD 3.68