Exemplo n.º 1
0
        private void HandleWindowMoveStart(WindowsWindow window)
        {
            if (_mouseMoveWindow != null)
            {
                _mouseMoveWindow.IsMouseMoving = false;
            }

            _mouseMoveWindow     = window;
            window.IsMouseMoving = true;
        }
Exemplo n.º 2
0
        private bool ShouldIgnoreWindow(WindowsWindow window)
        {
            var id = -1;

            try
            {
                id = window.ProcessId;
            } catch (Exception e) { }

            return(window.Class == "ConsoleWindowClass" && id == Process.GetCurrentProcess().Id);
        }
Exemplo n.º 3
0
 private void HandleWindowMoveEnd()
 {
     lock (_mouseMoveLock)
     {
         if (_mouseMoveWindow != null)
         {
             _mouseMoveWindow.IsMouseMoving = false;
             _mouseMoveWindow = null;
         }
     }
 }
Exemplo n.º 4
0
        private void RegisterWindow(IntPtr handle, bool emitEvent = true)
        {
            if (!_windows.ContainsKey(handle))
            {
                var window = new WindowsWindow(handle);

                if (!ShouldIgnoreWindow(window))
                {
                    window.WindowFocused += () => HandleWindowFocused(window);
                    _windows[handle]      = window;

                    if (emitEvent)
                    {
                        HandleWindowAdd(window, true);
                    }
                }
            }
        }
Exemplo n.º 5
0
 private void HandleWindowRemove(WindowsWindow window)
 {
     WindowDestroyed?.Invoke(window);
 }
Exemplo n.º 6
0
 private void HandleWindowAdd(WindowsWindow window, bool firstCreate)
 {
     WindowCreated?.Invoke(window, firstCreate);
 }
Exemplo n.º 7
0
 private void HandleWindowFocused(WindowsWindow window)
 {
     WindowFocused?.Invoke(window);
 }