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

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

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