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

            _mouseMoveWindow     = window;
            window.IsMouseMoving = true;
        }
Beispiel #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);
        }
Beispiel #3
0
 private void HandleWindowMoveEnd()
 {
     lock (_mouseMoveLock)
     {
         if (_mouseMoveWindow != null)
         {
             _mouseMoveWindow.IsMouseMoving = false;
             _mouseMoveWindow = null;
         }
     }
 }
Beispiel #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);
                    }
                }
            }
        }
Beispiel #5
0
 private void HandleWindowRemove(WindowsWindow window)
 {
     WindowDestroyed?.Invoke(window);
 }
Beispiel #6
0
 private void HandleWindowAdd(WindowsWindow window, bool firstCreate)
 {
     WindowCreated?.Invoke(window, firstCreate);
 }
Beispiel #7
0
 private void HandleWindowFocused(WindowsWindow window)
 {
     WindowFocused?.Invoke(window);
 }