A rusty wrapper over SetWinEventHook and UnhookWinEvent.
This example shows how to listen for all window events and print them to the console. ```rust use wineventhook::{EventFilter, WindowEventHook};
async fn main() { // Create a new hook let (eventtx, mut eventrx) = tokio::sync::mpsc::unboundedchannel(); let hook = WindowEventHook::hook( EventFilter::default(), eventtx, ).await.unwrap();
// Wait and print events
while let Some(event) = event_rx.recv().await {
println!("{:#?}", event);
}
// Unhook the hook
hook.unhook().await.unwrap();
} ```
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)