Skip to content

TrayOrder Mod: Sets the System Tray Icon Order #2947

Description

@Grosner300

Proposed Name: TrayOrder
Subtext: Deterministic System Tray Sequencing

  1. 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.

  2. 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. "|").

  1. 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.
  1. 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
  1. 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.
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions