锁定键盘和鼠标-VB.Net [英] Lock Keyboard and Mouse - VB.Net
问题描述
大家好,
如何在vb.net中锁定鼠标和键盘?
我曾经尝试过使用此代码:
私有声明功能块输入库"user32" (ByVal fBlock一样长)一样长
BlockInput(true)
该代码仅在我的应用程序中有效.我希望代码也可以在我的PC中工作.我的意思是,当我单击禁用"按钮时,我的鼠标和键盘无法在我的PC上(在PC上装满,不仅在应用程序中)不能完美运行.
Hay guys,
how can i lock the mouse and keyboard in vb.net?
i ever tried with this codes :
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
BlockInput (true)
the codes is only work in my application. i want, that the codes can work in my PC too. i mean, when i click the disable button, my mouse and my keyboard can't work perfectly on my PC (full of my PC and not only in application) .
推荐答案
迈克尔,
除了数据类型在您的配置文件中应为布尔值(而不是Long)这一事实之外,这不受支持.
apart from the fact that data types should be Boolean in your declraration (not Long), this is not supported.
您可能需要以编程方式锁定工作站:
LockWorkStation功能
You may want to lock the workstation programmatically:
LockWorkStation function
这篇关于锁定键盘和鼠标-VB.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!