Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sgm1018/BetterWinTab/llms.txt
Use this file to discover all available pages before exploring further.
WindowFolder represents a named grouping of windows in BetterWinTab’s sidebar. Folders can operate in several modes — from fully manual user assignments to composite rule-based smart filtering — controlled by the FolderType enum. The rule engine (FolderRuleGroup + FolderRuleCondition) powers the SmartRules folder type, enabling multi-condition AND/OR logic against any combination of process name, window title, and class name.
WindowFolder
Identity & Display
A unique identifier for this folder, stored as a
Guid serialized to a string (e.g., "3f2504e0-4f89-11d3-9a0c-0305e82c3301"). Generated at creation via Guid.NewGuid().ToString(). Used as a stable key for folder lookup, drag-and-drop ordering, and manual window handle association.The display label shown in the sidebar and folder header. Editable by the user.
A single Unicode character rendered as the folder’s icon glyph in the sidebar. Defaults to the Segoe MDL2 Assets folder icon (
\uE8B7). Users can customize this with any Unicode character, including emoji.A hex color string (e.g.,
"#FF5733") applied as a background tint to the folder item in the sidebar. An empty string means no background tint is applied and the folder uses the default surface color.Integer display order for the folder in the sidebar. Folders are rendered in ascending
SortOrder. Updated when the user reorders folders via drag-and-drop.Folder Type
Controls how windows are populated in this folder. See the FolderType enum table below for all valid values and their behaviors.
Filter Configuration
The process name to match for
SmartProcess-type folders (e.g., "Code", "chrome"). This is the legacy single-process filter, retained for backward compatibility with settings files created before the SmartRules system was introduced. New smart folders should use Rules instead.The Win32 window class name to match for
SmartClass-type folders (e.g., "Chrome_WidgetWin_1"). This is the legacy single-class filter, also kept for backward compatibility. New smart folders should prefer SmartRules with a ClassName condition.The composite rule group for
SmartRules-type folders. Holds an AND/OR operator and a list of FolderRuleCondition entries. See FolderRuleGroup below. null when the folder type is not SmartRules.Runtime Collections
The following two properties are decorated with
[JsonIgnore] and are never persisted to disk. They are populated at runtime during window enumeration and folder population. Do not rely on them having valid data outside of the active application session.The live, observable collection of
WindowInfo objects currently assigned to this folder. Bound directly to the WinUI 3 window grid via data binding. Repopulated on each window enumeration cycle.The set of raw Win32 window handles (
HWND) that the user has manually assigned to this folder. While Handle values are volatile across reboots, this set persists across window enumeration refreshes within a single session, allowing manual assignments to survive a Windows collection rebuild without requiring re-assignment.Methods
GetFilterSummary()
Returns a short human-readable string describing the folder’s current filtering logic. Used in the Settings panel and folder edit UI.
| FolderType | Example output |
|---|---|
All | "All open windows" |
SmartProcess | "Process: chrome" |
SmartClass | "Class: Chrome_WidgetWin_1" |
SmartRules (with rules) | "Rules (AND): ProcessName Equals \"Code\", Title Contains \"src\"" |
SmartRules (empty) | "Smart rules (empty)" |
Manual | "Custom folder" |
Clipboard | "Clipboard history" |
RecycleBin | "Recycle Bin" |
FolderType Enum
| Value | Description |
|---|---|
All | A catch-all folder that always displays every open window. Typically used for the default “All Windows” entry. |
Manual | The user explicitly assigns windows to this folder via drag-and-drop or the context menu. Window assignments are tracked in ManualWindowHandles. |
SmartProcess | Automatically includes all windows whose ProcessName matches ProcessFilter (case-insensitive). Legacy single-process filter. |
SmartClass | Automatically includes all windows whose ClassName matches ClassNameFilter (case-insensitive). Legacy single-class filter. |
SmartRules | Composite rule-based filtering using FolderRuleGroup. Supports multiple conditions with AND/OR logic across ProcessName, Title, and ClassName. The recommended approach for new smart folders. |
Clipboard | Special system folder that displays clipboard history items from BetterWinTab’s clipboard monitor. Not populated by window enumeration. |
RecycleBin | Special system folder shortcut that opens the Windows Recycle Bin when selected. |
FolderRuleGroup
FolderRuleGroup is the root of the rule tree for SmartRules folders. It holds a top-level logical operator and a flat list of conditions.
Determines how the individual conditions in
Conditions are combined. AND requires every condition to match; OR requires at least one to match. See RuleOperator.The list of individual conditions to evaluate. Each condition targets a single window field (
ProcessName, Title, or ClassName) and applies a comparison operator against a value string. See FolderRuleCondition below.Matches(WindowInfo window) Method
Evaluates the entire rule group against a window. Returns false immediately if Conditions is empty.
FolderRuleCondition
FolderRuleCondition represents a single predicate tested against one field of a WindowInfo. All string comparisons are case-insensitive.
Which property of the
WindowInfo to test. See RuleField.The comparison operator to apply between the field’s runtime value and
Value. See RuleComparison.The string to compare the field value against. For
Regex comparisons this is a .NET regular expression pattern. All other comparisons treat this as a literal string.Computed Display Properties
Read-only computed property that returns
Field.ToString(). Provides the string name of the active RuleField value (e.g., "ProcessName", "Title", "ClassName"). Used in compiled WinUI 3 XAML bindings where enum-to-string conversion is required directly in markup.Read-only computed property that returns
Comparison.ToString(). Provides the string name of the active RuleComparison value (e.g., "Equals", "Contains", "Regex"). Used in compiled WinUI 3 XAML bindings for display in the rule editor UI.Matches(WindowInfo window) Method
Resolves the target field value from window, then dispatches to the appropriate comparison:
Regex comparisons use TryRegexMatch, which wraps Regex.IsMatch in a try/catch and returns false on an invalid or malformed pattern rather than throwing an exception. This ensures that a bad regex entered by the user does not crash the enumeration pipeline.ToString() Method
Returns a compact representation used in GetFilterSummary() output:
RuleOperator Enum
| Value | Description |
|---|---|
AND | All conditions in the group must match for the window to be included. |
OR | Any single condition in the group matching is sufficient to include the window. |
RuleField Enum
| Value | Tested Property | Example value |
|---|---|---|
ProcessName | WindowInfo.ProcessName | "Code", "chrome", "explorer" |
Title | WindowInfo.Title | "README.md - MyProject" |
ClassName | WindowInfo.ClassName | "Chrome_WidgetWin_1", "Notepad" |
RuleComparison Enum
| Value | Behavior | Case-sensitive? |
|---|---|---|
Equals | Field must exactly match Value. | No (OrdinalIgnoreCase) |
Contains | Field must contain Value as a substring. | No (OrdinalIgnoreCase) |
StartsWith | Field must begin with Value. | No (OrdinalIgnoreCase) |
EndsWith | Field must end with Value. | No (OrdinalIgnoreCase) |
Regex | Field must match the .NET regex in Value (IgnoreCase flag set). Invalid patterns return false silently. | No (RegexOptions.IgnoreCase) |