Mit Keyboardhook input andere Programme sperren, wie?
-
Hallo,
ich habe hier ein Keyboardhook den ich mit SetWindowsHookEx setzte (global). wie kann ich so verhindern das andere programme den input der Tastatur bekommen? Kann ich das irgendwie in der KeyboardProc abfangen?
LG Tobi
-
Lies die Doku:
KeyboardProc
http://msdn.microsoft.com/en-us/library/ms644984(VS.85).aspxReturn Value
If code is less than zero, the hook procedure must return the value returned by CallNextHookEx.
If code is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_KEYBOARD hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the rest of the hook chain or the target window procedure.
-
Ah cool, hab ich wohl glatt übersehen, kann ich dann irgendein Wert rerun außer 0? Also so -1, 1, 2, 3, 4 ... ?
Lg Tobi
-
Alles klar, funktioniert super, danke Martin
