Ejemplo n.º 1
0
 /// <summary>
 /// Invoked when the selects a window in the switch windows scanner.
 /// Set focus to the selected window and quit the agent.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="windowInfo"></param>
 private void _switchWindowsScanner_EvtActivateWindow(object sender, EnumWindows.WindowInfo windowInfo)
 {
     _windowInfo = windowInfo;
     Windows.ActivateWindow(_windowInfo.Handle);
     closeScanner();
     Close();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// User selected a window to switch to.  Trigger an event
 /// to indicate this.
 /// </summary>
 /// <param name="wInfo">Window info of the window selected</param>
 private void handleWindowSelect(EnumWindows.WindowInfo wInfo)
 {
     if (!User32Interop.IsWindow(wInfo.Handle) || !User32Interop.IsWindowVisible(wInfo.Handle))
     {
         DialogUtils.ShowTimedDialog(this, R.GetString("WindowNotFound"));
     }
     else if (DialogUtils.ConfirmScanner(String.Format(R.GetString("ConfirmSwitchToWindow"), wInfo.Title)))
     {
         if (EvtActivateWindow != null)
         {
             EvtActivateWindow.BeginInvoke(this, wInfo, null, null);
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// User selected a window to switch to.  Trigger an event
 /// to indicate this.
 /// </summary>
 /// <param name="wInfo">Window info of the window selected</param>
 private void handleWindowSelect(EnumWindows.WindowInfo wInfo)
 {
     if (!User32Interop.IsWindow(wInfo.Handle) || !User32Interop.IsWindowVisible(wInfo.Handle))
     {
         DialogUtils.ShowTimedDialog(this, Resources.WindowDoesNotExist);
     }
     else if (DialogUtils.ConfirmScanner(string.Format(Resources.SwitchTo, wInfo.Title)))
     {
         if (EvtActivateWindow != null)
         {
             EvtActivateWindow.BeginInvoke(this, wInfo, null, null);
         }
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// User selected a window to switch to.  Trigger an event
 /// to indicate this.
 /// </summary>
 /// <param name="wInfo">Window info of the window selected</param>
 private void handleWindowSelect(EnumWindows.WindowInfo wInfo)
 {
     if (!User32Interop.IsWindow(wInfo.Handle) || !User32Interop.IsWindowVisible(wInfo.Handle))
     {
         DialogUtils.ShowTimedDialog(this, "Window does not exist");
     }
     else if (DialogUtils.ConfirmScanner("Switch to " + wInfo.Title + "?"))
     {
         if (EvtActivateWindow != null)
         {
             EvtActivateWindow.BeginInvoke(this, wInfo, null, null);
         }
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Invoked when the Functional agent is activated.  This is
        /// the entry point.
        /// </summary>
        /// <returns>true on success</returns>
        public override bool Activate()
        {
            _windowInfo           = null;
            ExitCode              = CompletionCode.ContextSwitch;
            _switchWindowsScanner = Context.AppPanelManager.CreatePanel("SwitchWindowsScanner") as SwitchWindowsScanner;

            if (_switchWindowsScanner != null)
            {
                subscribeToEvents();

                _switchWindowsScanner.FilterByProcessName = FilterByProcessName;
                Context.AppPanelManager.ShowDialog(_switchWindowsScanner);
            }

            return(true);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Invoked when the Functional agent is activated.  This is
        /// the entry point.
        /// </summary>
        /// <returns>true on success</returns>
        public override bool Activate()
        {
            _windowInfo           = null;
            ExitCode              = CompletionCode.ContextSwitch;
            _switchWindowsScanner = Context.AppPanelManager.CreatePanel("SwitchWindowsScanner") as SwitchWindowsScanner;

            if (_switchWindowsScanner != null)
            {
                _switchWindowsScanner.FormClosing       += _form_FormClosing;
                _switchWindowsScanner.EvtDone           += _form_EvtDone;
                _switchWindowsScanner.EvtActivateWindow += _switchWindowsScanner_EvtActivateWindow;

                _switchWindowsScanner.FilterByProcessName = FilterByProcessName;
                Context.AppPanelManager.ShowDialog(_switchWindowsScanner);
            }

            return(true);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Invoked when the selects a window in the switch windows scanner.
        /// Set focus to the selected window and quit the agent.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="windowInfo"></param>
        private void _switchWindowsScanner_EvtActivateWindow(object sender, EnumWindows.WindowInfo windowInfo)
        {
            _windowInfo = windowInfo;

            IsClosing = true;
            IsActive  = false;

            if (Windows.IsDesktopWindow(_windowInfo.Handle))
            {
                Context.AppAgentMgr.Keyboard.Send(Keys.LWin, Keys.D);
            }
            else
            {
                Windows.ActivateWindow(_windowInfo.Handle);
                EnumWindows.RestoreFocusToTopWindowOnDesktop();
            }

            closeScanner();
            Close();
        }
Ejemplo n.º 8
0
 public ItemTag(EnumWindows.WindowInfo info)
 {
     DataType = ItemType.Window;
     WInfo    = info;
 }