/WinEventHook

A managed wrapper over SetWinEventHook and UnhookWinEvent.

Primary LanguageC#The UnlicenseUnlicense

WinEventHook

nuget badge Unlicense

A managed wrapper over SetWinEventHook and UnhookWinEvent.

Installation

To install with NuGet use the following command in the Packet Manager Console:

Install-Package WinEventHook

Usage

Prints all events to the console:

using var hook = new WindowEventHook();
hook.EventReceived += (s, e) =>
    Console.WriteLine(Enum.GetName(typeof(WindowEvent), e.EventType));
hook.HookGlobal();
Console.Read();

Note: Your application needs a message loop to receive events.