Esempio n. 1
0
 private WindowCollection(IntPtr handle)
 {
     _shellHook = new ShellHook(handle);
     _shellHook.WindowCreated   += ShellHookWindowCreated;
     _shellHook.WindowDestroyed += ShellHookWindowDestroyed;
     _shellHook.EnumWindows();
 }
Esempio n. 2
0
        private void ShellHookWindowDestroyed(ShellHook sender, IntPtr hwnd)
        {
            Win32Window window;

            if (_windows.TryGetValue(hwnd, out window))
            {
                OnWindowDestroyed(window);
                _windows.Remove(hwnd);
            }
        }
Esempio n. 3
0
        public void Dispose()
        {
            if (_shellHook == null)
            {
                return;
            }

            Trace.WriteLine("Dispose Shell Hook");
            _shellHook.Dispose();
            _shellHook = null;
        }
Esempio n. 4
0
        private void ShellHookWindowCreated(ShellHook sender, IntPtr hWnd)
        {
            Win32Window window;

            if (_windows.TryGetValue(hWnd, out window))
            {
                window = new Win32Window(hWnd);
                _windows.Add(hWnd, window);
            }

            OnWindowCreated(window);
        }