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, 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()

Initializes a new instance of SimpleGlobalHook.

public SimpleGlobalHook()
See Also

SimpleGlobalHook(IGlobalHookProvider)

Initializes a new instance of SimpleGlobalHook.

public SimpleGlobalHook(IGlobalHookProvider globalHookProvider)

Parameters

globalHookProvider IGlobalHookProvider

The underlying global hook provider.

Exceptions

ArgumentNullException

globalHookProvider is null.

See Also

SimpleGlobalHook(IGlobalHookProvider, bool)

Initializes a new instance of SimpleGlobalHook.

public SimpleGlobalHook(IGlobalHookProvider globalHookProvider, bool runAsyncOnBackgroundThread)

Parameters

globalHookProvider IGlobalHookProvider

The underlying global hook provider.

runAsyncOnBackgroundThread bool

true if RunAsync() should run the hook on a background thread. Otherwise, false.

Exceptions

ArgumentNullException

globalHookProvider is null.

See Also

SimpleGlobalHook(bool)

Initializes a new instance of SimpleGlobalHook.

public SimpleGlobalHook(bool runAsyncOnBackgroundThread)

Parameters

runAsyncOnBackgroundThread bool

true if RunAsync() should run the hook on a background thread. Otherwise, false.

See Also

Methods

HandleHookEvent(ref UioHookEvent)

Handles the hook event.

protected override void HandleHookEvent(ref UioHookEvent e)

Parameters

e UioHookEvent

The event to handle.

See Also

See Also