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

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

            Trace.WriteLine("Dispose Shell Hook");
            _shellHook.Dispose();
            _shellHook = null;
        }
Exemplo 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);
        }