I've read from a few different sources that BlockInput requires admin rights on Vista and 7.
It works just fine for me running as admin - on Windows 7 with UAC disabled and Windows Vista SP2 with UAC enabled. As a limited user (tested only on my Vista VM, which has UAC enabled), I am denied access. The following may be used to troubleshoot:
Code:
if DllCall("BlockInput", "int", 1) ; attempt to block
DllCall("BlockInput", "int", 0) ; unblock
else
MsgBox BlockInput failed, error %A_LastError%.
; ERROR_ACCESS_DENIED = 5
Jasdeep wrote:
even after running it as a admin it didnt worked
I have no explanation for that. Are you sure it was running as admin?
Code:
MsgBox % A_IsAdmin ; Should display 1.
A limited workaround when BlockInput doesn't work is to create numerous hotkeys, as in
Andreone's script or to
register a keyboard hook (a mouse hook would also be feasible).