doc/devdocs/modules/launcher/plugins/windowwalker.md
The window walker plugin matches the user entered query with the open windows on the system. The user can switch to the found windows, close them or kill their process.
ApplicationFrameHost.exe. If the user searches for such a window while it is not minimized, then the process gets assigned correctly/updated.File Explorer setting below.)Launch folder windows in a separate process under Folder Options > View has to be enabled.Folder options dialog by clicking the information message in the search results. The information message is only shown when searching with action keyword for explorer windows and can be hidden in the plugin settings.The optional plugin settings are implemented via the ISettingProvider interface from Wox.Plugin project.
All available settings for the plugin are defined in the WindowWalkerSettings class of the plugin. The settings can be accessed everywhere in the plugin code via the static class instance WindowWalkerSettings.Instance.
We have the following settings that the user can configure to change the behavior of the plugin:
| Key | Default value | Name/Description |
|---|---|---|
ResultsFromVisibleDesktopOnly | false | Show only results from visible desktop |
SubtitleShowPid | false | Show process id in subtitle |
SubtitleShowDesktopName | true | Show desktop name in subtitle (If two or more desktops exist) |
ConfirmKillProcess | true | Request confirmation when killing a process |
KillProcessTree | false | Kill process and its child processes |
OpenAfterKillAndClose | false | Stay open after closing windows and killing processes (Not working with kill process confirmation) |
HideKillProcessOnElevatedProcesses | false | Hide "kill process" button if additional permissions required |
HideExplorerSettingInfo | false | Hide Explorer process information |
OpenWindows.csEnumWindows function to enumerate all the open windows in the OpenWindows.cs class.SearchController.csSearchController encapsulates the functions needed to search and find matches.Window.csWindow 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), the SwitchToWindow function which switches the desktop focus to the selected window and the CloseThisWindow function which closes the window. The switchToWindow action is performed when the user clicks on a window walker plugin result.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 type WindowProcess.VirtualDesktopHelper in Wox.Plugin project. The instance of VirtualDesktopHelper is cached in the Main class of the plugin at runtime. The desktop information is stored in a property of the type VDesktop.WindowProcess.csWindowProcess class represents a specific process for a window.KillThisProcess to kill the process. (If the user has not enough permissions to kill a process they are requested via UAC.)ResultHelper.csResultHelper class contains the code to create the list with all results for PT Run based on the data returned from SearchController class.ContextMenuHelper.csContextMenuHelper class provides the code for the context menu items.WindowWalkerSettings.csWindowWalkerSettings class provides access to all optional plugin settings.Instance that holds an instance of the class itself. This allows us to access the settings from everywhere in the plugin code without having additional parameters in our methods.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.
We have a Unit Test project that executes various test to ensure that the plugin works as expected.
PluginSettingsTests.csPluginSettingsTests.cs class contains tests to validate that all settings exist and that they have the correct default values.