Ejemplo n.º 1
0
        public HookService()
        {
            this.detector.Pressed += this.KeyHookOnPressed;
            this.detector.Start();

            this.helper = VDMHelper.helper;
        }
Ejemplo n.º 2
0
        public static VirtualDesktop MoveToRight(this IntPtr hWnd, IVdmHelper helper)
        {
            var current = VirtualDesktop.FromHwnd(hWnd);

            if (current != null)
            {
                var right = current.GetRight();
                if (right == null)
                {
                    if (Settings.General.LoopDesktop)
                    {
                        var desktops = VirtualDesktop.GetDesktops();
                        if (desktops.Length >= 2)
                        {
                            right = desktops.First();
                        }
                    }
                }
                if (right != null)
                {
                    if (VirtualDesktopHelper.MoveToDesktop(hWnd, right) ||
                        helper.MoveWindowToDesktop(hWnd, right.Id))
                    {
                        return(right);
                    }
                }
            }

            SystemSounds.Asterisk.Play();
            return(null);
        }
Ejemplo n.º 3
0
        public HookService()
        {
            this.detector.Pressed += this.KeyHookOnPressed;
            this.detector.Start();

            this.helper = VdmHelperFactory.CreateInstance();
            this.helper.Init();
        }
Ejemplo n.º 4
0
        public static VirtualDesktop MoveToNew(this IntPtr hWnd, IVdmHelper helper)
        {
            var newone = VirtualDesktop.Create();

            if (newone != null)
            {
                if (VirtualDesktopHelper.MoveToDesktop(hWnd, newone) ||
                    helper.MoveWindowToDesktop(hWnd, newone.Id))
                {
                    return(newone);
                }
            }

            SystemSounds.Asterisk.Play();
            return(null);
        }
        public VirtualDesktopGridManager(SysTrayProcess sysTrayProcess, SettingValues settings)
        {
            this.settings       = settings;
            this.sysTrayProcess = sysTrayProcess;

            VDMHelper = VdmHelperFactory.CreateInstance();
            VDMHelper.Init();

            foregroundWindowChangedDelegate = new WinAPI.WinEventDelegate(ForegroundWindowChanged);
            fgWindowHook = WinAPI.SetWinEventHook(WinAPI.EVENT_SYSTEM_FOREGROUND, WinAPI.EVENT_SYSTEM_FOREGROUND, IntPtr.Zero, foregroundWindowChangedDelegate, 0, 0, WinAPI.WINEVENT_OUTOFCONTEXT);

            // Create a custom message ID for other processes to trigger actions.
            commandWindowMessage = RegisterWindowMessage("VIRTUALDESKTOPGRIDSWITCHER_COMMAND");
            Application.AddMessageFilter(this);

            Start();
        }
Ejemplo n.º 6
0
 public HookService(IVdmHelper helper)
 {
     this._detector.Pressed += this.KeyHookOnPressed;
     this._detector.Start();
     this._helper = helper;
 }
Ejemplo n.º 7
0
 public PinService(IVdmHelper helper)
 {
     this._helper = helper;
     VirtualDesktop.CurrentChanged += this.VirtualDesktopOnCurrentChanged;
 }
Ejemplo n.º 8
0
 public HookService(IVdmHelper helper)
 {
     this._detector.Pressed += this.KeyHookOnPressed;
     this._detector.Start();
     this._helper = helper;
 }