private void Hook_EventProc(IntPtr hWinEventHook, WinEvent @event, IntPtr hwnd, WinObject objectId, WinChild childId, int thread, uint time) { var args = new WinEventEventArgs(this, @event, hwnd, objectId, childId, thread, time); CallbackContext(() => { HookTriggered?.Invoke(this, args); foreach (var s in Observers) { s.OnNext(args); } }); }
internal WinEventEventArgs(WinEventHook hook, WinEvent @event, IntPtr hwnd, WinObject @object, WinChild child, int threadId, uint time) { this.Hook = hook; this.Event = @event; this.Window = new Win32Window(hwnd); this.WinObject = @object; this.WinChild = child; this.ThreadId = threadId; this.Timestamp = time; }