Exemplo n.º 1
0
        public ActiveWindowWatcher()
        {
            this.winEvent = this.WinEventProc;

            this.hook = Imports.SetWinEventHook(Imports.EventSystemForeground, Imports.EventSystemForeground,
                                                IntPtr.Zero, this.winEvent, 0, 0, Imports.WinEventOutOfContext);
        }
Exemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing && this.Disposed == false)
            {
                this.Disposed = true;

                Imports.UnhookWinEvent(this.hook);

                this.Windows.OnCompleted();

                this.winEvent = null;
            }
        }