Proposed Name: TrayOrder
Subtext: Deterministic System Tray Sequencing
-
Summary
TrayOrder is a suggestion for a WindHawk mod designed to override the default Windows Shell behavior for system tray icon placement. Instead of Windows deciding the order based on launch timing or internal grouping logic, this mod enforces a user-defined hierarchy using granular process identification.
-
Core Functionality
Command-Line Identification: Moves beyond simple process names (e.g., AutoHotkey64.exe) to identify icons by their full command-line strings (e.g., AutoHotkey64.exe "C:\Scripts\VolumeControl.ahk").
Sticky Positioning: Ensures that even if an application crashes and restarts, or a new icon is added mid-session, the tray re-sorts itself to maintain the defined priority.
Deterministic Grouping: Disables the "magnetic" grouping of identical process names, allowing users to sandwich different apps between specific script instances.
Grouping: Enables setting iCon Groups and setting the group order in addition to the individual icon order in the group. Includes ability to add a group separator character (e.g. "|").
- Detailed Feature Specifications
Feature Description
- Priority Mapping
A UI table where users input a Search String (Regex or partial match) and a Weight Value
(Lower numbers = further from the clock).
- Wildcard Support
Ability to use * to catch all instances of a process while specifically ordering others.
- Real-time Re-sorting
The mod hooks into the Shell_NotifyIcon function to intercept new icon creation and trigger a tray refresh.
- Hidden Icon Support
Applies the same ordering logic to both the visible tray and the "overflow" (chevron) menu.
- User Interface & Configuration
- The mod should feature a configuration screen within WindHawk with the following columns:
- Identifier Type: (Dropdown: Process Name, Command Line, or Window Title).
- Match Pattern: (Text field for the path or string).
- Priority Index: (Numeric field; e.g., 1 is far right, 99 is far left).
- Active: (Checkbox to toggle specific rules).
Example Rule Logic:
Match: *WorkScript.ahk* → Priority: 1
Match: *Slack.exe* → Priority: 2
Match: *HomeScript.ahk* → Priority: 3
- Technical Implementation Notes (for the Developer)
- Target Process: explorer.exe
- Hooking Points: You will likely need to hook the ToolbarWindow32 control responsible for the notification area or intercept the messages sent to the SysPager.
- The "Gap" Problem: Windows 11 uses a modern XAML-based tray in some builds; the mod must account for whether it's targeting the classic Win32 toolbar logic or the newer implementation.
- Sorting Trigger: Use a small debounce timer (e.g., 200ms) after a new icon is registered to prevent flickering during mass-bootup of apps.
- Why this is better than "Standard" Behavior
Currently, if you have three AHK scripts, Windows views them as a single "stack." If you drag one, the others often follow or jump positions randomly. TrayOrder would treat every unique command line as a distinct entity with its own "assigned seat" at the table.
Proposed Name: TrayOrder
Subtext: Deterministic System Tray Sequencing
Summary
TrayOrder is a suggestion for a WindHawk mod designed to override the default Windows Shell behavior for system tray icon placement. Instead of Windows deciding the order based on launch timing or internal grouping logic, this mod enforces a user-defined hierarchy using granular process identification.
Core Functionality
Command-Line Identification: Moves beyond simple process names (e.g., AutoHotkey64.exe) to identify icons by their full command-line strings (e.g., AutoHotkey64.exe "C:\Scripts\VolumeControl.ahk").
Sticky Positioning: Ensures that even if an application crashes and restarts, or a new icon is added mid-session, the tray re-sorts itself to maintain the defined priority.
Deterministic Grouping: Disables the "magnetic" grouping of identical process names, allowing users to sandwich different apps between specific script instances.
Grouping: Enables setting iCon Groups and setting the group order in addition to the individual icon order in the group. Includes ability to add a group separator character (e.g. "|").
Currently, if you have three AHK scripts, Windows views them as a single "stack." If you drag one, the others often follow or jump positions randomly. TrayOrder would treat every unique command line as a distinct entity with its own "assigned seat" at the table.