我需要一个函数能够在我写的函数刚开始禁用且只禁用鼠标(所有点击无效)(windows10),我的函数结束时恢复鼠标。若有人能直接给我这个函数我愿意采纳他的答案。我已经尝试过使用hook但是没用。
哈哈,前不久刚写过博客,得用全局钩子(360得加入白名单,否则会被拦截),详细请见我的博客(目前收费)“超级鼠标键盘锁”
除了鼠标被屏蔽外,还可以屏蔽键盘(包括Ctrl+Alt+Del、Win+L等系统键)
链接:https://blog.csdn.net/wlwdecs_dn/article/details/114081337
整个工程的下载地址:https://blog.csdn.net/wlwdecs_dn/article/details/114107420
购买了专栏,专栏里所有文章都可见,工程代码也可下载
望采纳
禁用
#include<stdio.h>
int main()
{
system("reg add HKEY_LOCAL_MACHINE\\system\\CurrentControlSet\\Services\\Mouclass /v Start /t REG_DWORD /d 4 /f");
return 0;
}
启用
#include<stdio.h>
int main()
{
system("reg add HKEY_LOCAL_MACHINE\\system\\CurrentControlSet\\Services\\Mouclass /v Start /t REG_DWORD /d 3 /f");
return 0;
}
禁用
#include<stdio.h>
int main()
{
system("sc config Mouclass start= disabled");
return 0;
}
开启
#include<stdio.h>
int main()
{
system("sc config Mouclass start= enabled");
return 0;
}
win10的话,pnputil命令支持禁用启用设备。
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mouclass\Enum注册表右侧,count记录了鼠标设备数量,0、1、2、3这些的值是实例ID。
禁用这些设备,命令是:
pnputil /disable-device "实例ID"
启用是:
pnputil /enable-device "实例ID"
如“ pnputil /disable-device "USB\VID_045E&PID_00DB\6&870CE29&0&1"。
代码可以参考博文:https://blog.csdn.net/CJ_WORLD/article/details/102629149
我记得有隐藏鼠标的接口提供啊?
实在不行就把它移到不存在的位置,等函数结束再移回来原来的位置
我可把exe文件发你进行试用,有意请私信
https://zhidao.baidu.com/question/431105109217329612.html
https://blog.csdn.net/qq_46527915/article/details/105171026
你试试这两个
可以阿
https://blog.csdn.net/F_hawk189/article/details/112094875
但是你给的云盘文件Debug跑不了....
抱歉我只会vs全家桶,cmake接触过一点,makefile就直接没接触了...