/// <summary>
 /// Constructor
 /// </summary>
 public WindowSearchResult(Window window, List<int> matchesInTitle, List<int> matchesInProcessName, SearchType matchType)
 {
     this.ResultWindow = window;
     this.SearchMatchesInTitle = matchesInTitle;
     this.SearchMatchesInProcessName = matchesInProcessName;
     this.SearchResultMatchType = matchType;
     this.CalculateScore();
 }
Пример #2
0
        /// <summary>
        /// Call back method for window enumeration
        /// </summary>
        /// <param name="hwnd">The handle to the current window being enumerated</param>
        /// <param name="lParam">Value being passed from the caller (we don't use this but might come in handy
        /// in the future</param>
        /// <returns>true to make sure to contiue enumeration</returns>
        public bool WindowEnumerationCallBack(IntPtr hwnd, IntPtr lParam)
        {
            Window newWindow = new Window(hwnd);

            if (newWindow.Visible && !newWindow.ProcessName.ToLower().Equals("iexplore.exe") ||
                (newWindow.ProcessName.ToLower().Equals("iexplore.exe") && newWindow.ClassName == "TabThumbnailWindow"))
            {
                this.windows.Add(newWindow);

                if (OnOpenWindowsUpdate != null)
                {
                    this.OnOpenWindowsUpdate(this, new Window.WindowListUpdateEventArgs());
                }
            }

            return true;
        }
Пример #3
0
 public void OpenWindowsUpdateHandler(object sender, Window.WindowListUpdateEventArgs e)
 {
     this.SyncOpenWindowsWithModelAsync();
 }
Пример #4
0
 /// <summary>
 /// Constructor for WindowResult
 /// </summary>
 public WindowResult(Window window)
     : base(window.Hwnd)
 {
     LettersInBetweenScore = WindowResult.NoResult;
 }