Lock mouse and keybord in VB.NET
Is there a way to block the mouse/keybord from .NET but System-wide? I tried with
<System.Runtime.InteropServices.DllImport("User32.dll")> _
Public Shared Function BlockInput(ByVal block As Boolean) As Boolean
End Function
but it did not work.
I would like to avoid solutions like loading 开发者_Python百科a driver, but I am open to that if needs be.
Edit: It did not work, because I stupidly did NOT run it with Administrator priviledges. So, the real question is how to block Ctrl-Alt-Del. Sorry for the mix-up and thank you for your answers!
Thank you,
John
For fine-grained control you could set up global hooks for the mouse and keyboard - WH_KEYBOARD_LL and WH_MOUSE_LL - then suppress the keystrokes and mouse movements by returning (IntPtr)1
from the hook instead of calling CallNextHookEx
精彩评论