I am trying to disable only keyboard input on Windows. Therefore, I want to register a hook, which will not call the next hook.
from ctypes import *
def hookProc(nCode, wParam, lParam):
return 0
CMPFUNC = CFUNCTYPE(c_int, c_int, c_int, POINTER(c_void_p))
res = windll.user32.SetWindowsHookExA(13, CMPFUNC(hookProc), windll.kernel32.GetModuleHandleW(None), 0)
print(res)
This prints 0
on my Windows 11 machine. Why?
New contributor
Richard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.