public ActiveWindowWatcher() { this.winEvent = this.WinEventProc; this.hook = Imports.SetWinEventHook(Imports.EventSystemForeground, Imports.EventSystemForeground, IntPtr.Zero, this.winEvent, 0, 0, Imports.WinEventOutOfContext); }
protected virtual void Dispose(bool disposing) { if (disposing && this.Disposed == false) { this.Disposed = true; Imports.UnhookWinEvent(this.hook); this.Windows.OnCompleted(); this.winEvent = null; } }