mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 11:39:16 +08:00
edc43e39ca
* Import files from old PR #15329 * Improvements * hide uwp non-windows (#13637) * update debug tool tip * fix spelling and comments * disable tool tip * fix doc links * remove obsolete using * Update docs * fix spelling * rename elevation property and test method * Add property <DoesExist> to WindowProcess class * Close process handles correctly if not used anymore * cleanup coed * fix bug with sticky notes process * add window class to tool tip * small change * make nativeMethods static class * fix broken uwpApp property of WindowProcess class * rename method * Revert making NativeMethods class static. It contains instance members. * improve loggign * fix merge mistakes * fixes * remove obsolete delegate * Improve SearchController to speed up search (#15561) * add <IsShellProcess> property to <WindowProcess> class * reorder code * disable debug tool tip * Update devdocs * remove obsolete event handler * update var name
2.4 KiB
2.4 KiB
Window Walker plugin
The window walker plugin matches the user entered query with the open windows on the system.
OpenWindows.cs
- The window walker plugin uses the
EnumWindows
function to enumerate all the open windows in theOpenWindows.cs
class.
SearchController.cs
- The
SearchController
encapsulates the functions needed to search and find matches. - It is responsible for updating the search text and performing a fuzzy search on all the open windows.
Window.cs
- The
Window
class represents a specific window and has functions to get the name of the window, the state of the window (whether it is visible or not), and theSwitchTowindow
function which switches the desktop focus to the selected window. This action is performed when the user clicks on a window walker plugin result. - The
Window
class holds a static cache with the process information of all windows we know so far and each window instance has a property which holds its process information (name, file, ...). The process data in the cache and the window property are of the typeWindowProcess
.
WindowProcess.cs
- The
WindowProcess
class represents a specific process for a window. It contains static methods to query process information from the system. And it contains instance methods and properties to hold/retrieve the process information we want to know about a window's process.
Score
The window walker plugin uses FuzzyMatching
to get the matching indices and calculates the score by creating a 2 dimensional array of the window and the query text.