Class SimpleGlobalHook
- Namespace
- SharpHook
- Assembly
- SharpHook.dll
Represents an implementation of IGlobalHook which raises events on the same thread on which the hook itself runs.
public sealed class SimpleGlobalHook : GlobalHookBase, IGlobalHook, IBasicGlobalHook, IDisposable
- Inheritance
-
SimpleGlobalHook
- Implements
- Inherited Members
Remarks
The event handlers should generally be fast and simple so that the thread can process all raised events. If you need to do a lot of processing in the event handlers then consider using another implementation, e.g., TaskPoolGlobalHook.
Constructors
SimpleGlobalHook(GlobalHookType, IGlobalHookProvider?, bool)
Initializes a new instance of SimpleGlobalHook.
public SimpleGlobalHook(GlobalHookType globalHookType = GlobalHookType.All, IGlobalHookProvider? globalHookProvider = null, bool runAsyncOnBackgroundThread = false)
Parameters
globalHookTypeGlobalHookTypeThe global hook type.
globalHookProviderIGlobalHookProviderThe underlying global hook provider, or null to use the default one.
runAsyncOnBackgroundThreadbooltrue if RunAsync() should run the hook on a background thread. Otherwise, false.
Methods
HandleHookEvent(ref UioHookEvent)
Handles the hook event.
protected override void HandleHookEvent(ref UioHookEvent e)
Parameters
eUioHookEventThe event to handle.