Table of Contents

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

globalHookType GlobalHookType

The global hook type.

globalHookProvider IGlobalHookProvider

The underlying global hook provider, or null to use the default one.

runAsyncOnBackgroundThread bool

true 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

e UioHookEvent

The event to handle.

See Also