[This is preliminary documentation and is subject to change.]

Registers a low-level keyboard hook on curent thread. The thread will be exited when hook is unregistered.

Namespace: Tools.API.Hooks
Assembly: Tools.Win (in Tools.Win.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public void RegisterAsyncHook()
Visual Basic
Public Sub RegisterAsyncHook
Visual C++
public:
void RegisterAsyncHook()
F#
member RegisterAsyncHook : unit -> unit 
JScript
public function RegisterAsyncHook()

Remarks

When hok is registered as asynchronous the HookProc(Int32, IntPtr, IntPtr) function is called in special thread. You can use this approach to handle the event in your form and use Invoke(Delegate) to run event-handling code. The code then does not block keyboard hook which immediately returns.

Exceptions

ExceptionCondition
System..::..InvalidOperationExceptionHook was already registered for this instance (Registered is true)
Tools.API..::..Win32APIExceptionAn error ocured while obtaining the hook.
System..::..ObjectDisposedExceptionIsDisposed is true

See Also