ProcessHandler is a fast, native Windows process automation service and task monitor built in 100% pure Rust. Designed as a dual-tier system, it decouples background execution from user interaction:
- System Tray Daemon: An ultra-low overhead background service that listens reactively to system events, process lifecycles, and triggers, managing schedules and executing automated rule pipelines with zero window baggage.
- Interactive Desktop GUI: A hardware-accelerated, high-DPI desktop interface powered by
eguiandeframe, communicating seamlessly with the daemon via high-throughput Windows Named Pipes (\\.\pipe\ProcessHandler_daemon).
Whether you need to boost game performance by binding companion utilities, safeguard your PC from rogue memory leaks, or automate daily workflow scripts, ProcessHandler delivers full control with near-zero resource utilization (<0.1% CPU, ~2MB RAM).
- Event-driven process detection via native Windows WMI subscriptions and low-latency snapshotting
- Versatile trigger engine spanning process lifecycles, window focus, CPU/RAM thresholds, global hotkeys, file watcher, webhooks, and schedules
- Pre-conditions & logic branching with multi-condition checks (running apps, window focus, time/days, power, files), AND/OR chaining, and dynamic If/Else action flows
- Flexible action pipeline covering process control, window management, CPU/memory tuning, scripts, macros, audio devices, and webhooks
- Embedded Lua 5.4 runtime (
mlua) with dedicatedphAPI alongside PowerShell and Batch scripting - Macro Studio with hardware keyboard/mouse recording, in-game 3D camera rotation support, timeline editing, loop control, and organic jitter
- Deep Windows audio & device control covering per-process volume/mute, master sound, and default playback/mic devices (WASAPI)
- Companion process mode with automated lifecycle coupling and graceful exit cleanup
- Ultra-lightweight daemon architecture with background tray operation (<0.1% CPU, ~2MB RAM) and named-pipe IPC
- Portable rule sharing via compressed, self-contained clipboard codes (single and batch import/export)
Specifically:
Process Monitoring & Detection
- Event-Driven Subscriptions: Direct Windows WMI hooks for instant process start/exit detection without CPU-heavy polling loops.
- Fallback Polling Engine: High-frequency snapshotting fallback for restricted or custom environments.
- Native Icon Extraction: Real-time extraction of high-resolution Win32 application icons rendered directly into the interface.
Automation & Rules Engine
- Triggers:
- Process Lifecycle: Target application launch, termination, or duration (exact match, wildcard, regex).
- Window Focus: Gain or loss of active foreground window focus.
- Resource Thresholds: Sustained high CPU (%) or RAM (MB) usage limits.
- Global Hotkeys: System-wide shortcut listener with toggle mode, hold mode, and repeat-while-held execution.
- File Watcher: File and folder creation, modification, or deletion with extension filters.
- Local Webhooks: Inbound HTTP REST requests (
http://127.0.0.1:48123/api/v1/trigger/{endpoint}). - Schedules & Alarms: Fixed intervals, daily recurring schedules, and one-shot date/time alarms.
- System & Power: User idle/active state, session lock/unlock, sleep/wake, and AC/battery transitions.
- Rule Pre-conditions:
- Gating Criteria: Running process, active window focus, time window & days of week, power source (AC mains vs battery), and file existence check.
- Chainable Logic: Combine multiple conditions with boolean AND / OR operators.
- Action Pipelines:
- Logic & Branching: Dynamic If / Else If / Else actions with condition checks to execute conditional sub-pipelines.
- Process Control: Launch (custom arguments, working dir, admin, hidden mode), terminate process trees, or restart.
- Window Management: Minimize, maximize, restore, hide, show, close, transparency, always-on-top, and screen positioning.
- Process Tuning: Dynamically adjust CPU priority (Realtime to Idle), set core affinity masks, and trim memory working sets.
- Scripting & Automation: Embedded Lua 5.4 (
phAPI), PowerShell, and Batch scripts with token interpolation ({pid},{process},{window_title},{file_path}). - Macro Playback: Recorded keyboard and mouse sequences (with in-game 3D camera turns, DirectInput scancodes, and instant stuck-key release on cancellation), speed multipliers, loop counts, and organic jitter.
- Audio & Device Control: System and per-app volume/mute, microphone levels, and default playback/recording device switching.
- Alerts & Webhooks: Windows toast notifications and outbound HTTP REST calls (POST/GET/PUT).
- System Power & Delays: System lock, sleep, display off, shutdown, and configurable pause intervals between steps.
- Execution & Safeguards:
- Non-blocking asynchronous task execution with per-step action testing directly in the editor.
- Cooldowns, execution limits (
max_executions), execution counters, rule cloning, and multi-level Undo/Redo (Ctrl+Z / Ctrl+Y). - One-click clipboard import/export of rules via compressed portable payloads.
Companion Process Mode
- Lifecycle Binding: Attach companion utilities, overlays, or performance monitors to a primary game or application.
- Automated Cleanup: Automatically terminates companion processes and reverts system state when the primary application closes.
Architecture & System Integration
- Dual-Tier Decoupled Architecture: Lightweight background daemon (<0.1% CPU, ~2MB RAM) running continuously in the system tray, separated from the desktop GUI.
- Named Pipes IPC: Fast, thread-safe local communication between interface and daemon (
\\.\pipe\ProcessHandler_daemon). - Tray & Startup Control: Unobtrusive system tray icon with quick actions and one-click Windows startup registration.
- In-App Auto-Updater: Built-in GitHub Releases checker with zero-downtime binary updates.
User Interface & Workspace
- Visual Studio: Hardware-accelerated interface with Dark, Light, and Chocolate palettes, plus full English and Russian localization.
- Interactive Rule Builder: Drag-and-drop step reordering, real-time step execution tracking, target process icon detection, and multi-step Undo/Redo.
- Macro Studio & Editor: Built-in input recorder with desktop cursor & in-game camera capture, one-click coordinate mode toggling, timeline editing, speed/loop settings, and organic motion controls.
- Action Catalog & Process Picker: Fast in-context modal dialogs to browse actions and pick active processes without losing editor draft.
- Analytics & Telemetry: Monospace event stream with live KPI metrics (Total Executions, Active Rules, System Uptime) and category filters.
- Built-in Documentation: In-app GitBook-style guide with architecture overview, shortcut cheat sheets, and practical recipes.
- Windows 10 / 11 (64-bit)
To install, download the latest release from GitHub Releases:
- Portable Version (
ProcessHandler.exe): Place the executable in any convenient directory and run it.
Note
When you run ProcessHandler for the first time, it automatically registers itself in the Windows startup list. You can always toggle the startup option in the settings window. (If you move the executable file, the startup may stop working; simply turn it off and then back on again.)
Development Setup
- Rust (1.75+ recommended, MSVC toolchain)
# Clone the repository
git clone https://github.com/psyattack/ProcessHandler.git
cd ProcessHandler
# Run in development mode (spawns daemon and opens GUI)
cargo run
# Run only the GUI (connects to an existing background daemon)
cargo run -- --gui
# Run only the background daemon (tray mode)
cargo run -- --daemon
# Execute test suite
cargo test
# Run Clippy linter
cargo clippy --tests
# Build optimized release binary
cargo build --releaseThe compiled binary will be located at target\release\ProcessHandler.exe.
|
|
View structure
ProcessHandler/
├── assets/ # Application assets & branding
│ ├── fonts/ # Bundled variable fonts (Archivo, GeistMono, Inter)
│ ├── app.ico # Win32 application icon
│ ├── app.png # High-res RGBA icon
│ └── app.svg # Vector logo
├── src/ # Source code
│ ├── daemon/ # Background daemon service
│ │ ├── actions.rs # Execution handlers (Process, Window, Tuning, Audio, Scripts, Macros)
│ │ ├── engine.rs # Central automation state engine & rule evaluator
│ │ ├── file_watcher.rs # Filesystem polling & directory event watcher
│ │ ├── hotkeys.rs # Low-level global hotkey listener & hold-mode engine
│ │ ├── ipc_server.rs # Named pipe listener & connection worker
│ │ ├── lua_runner.rs # Embedded Lua 5.4 execution runner with custom `ph` API
│ │ ├── system_events.rs # Win32 idle time & AC/battery power monitor
│ │ ├── tray.rs # Win32 system tray manager, menu & message loop
│ │ ├── watcher.rs # WMI events & Toolhelp32 process snapshotting
│ │ └── webhook_server.rs # Local HTTP webhook server (port 48123)
│ ├── gui/ # egui desktop user interface
│ │ ├── components/ # UI components
│ │ │ ├── icons.rs # Win32 shell icon extractor, image loader & texture cache
│ │ │ ├── modal.rs # Unified animated modal window framework
│ │ │ ├── script_highlighter.rs # PowerShell, Batch & Lua syntax highlighter
│ │ │ └── widgets.rs # Custom canvas controls (buttons, inputs, cards, drag handles, glyphs)
│ │ ├── views/ # Application screens & panels
│ │ │ ├── action_catalog_modal.rs # Studio modal for categorized action browsing & search
│ │ │ ├── analytics_view.rs # Real-time event telemetry stream & KPI metric cards
│ │ │ ├── changelog_modal.rs # GitHub release notes & changelog viewer
│ │ │ ├── guide_modal.rs # GitBook-style interactive documentation & recipes
│ │ │ ├── header_bar.rs # Custom window titlebar & navigation tabs
│ │ │ ├── inspector.rs # Rule inspector, trigger & action editor (drag-and-drop, undo/redo)
│ │ │ ├── macro_modal.rs # Macro timeline editor & playback studio
│ │ │ ├── process_picker_modal.rs # In-context process picker modal with filter & sorting
│ │ │ ├── rules_view.rs # Rule management list & cards
│ │ │ ├── script_modal.rs # Expandable script editor modal (PowerShell, CMD, Lua)
│ │ │ └── settings_view.rs # Balanced 2x2 settings (System, Engine, Appearance, Updates)
│ │ ├── macro_recorder.rs # Win32 low-level keyboard/mouse macro recorder
│ │ ├── state.rs # GUI state management & IPC synchronization
│ │ └── theme.rs # Design system tokens (Dark, Light, Chocolate palettes)
│ ├── i18n/ # Internationalization & localization
│ │ ├── en.rs # English string catalog
│ │ └── ru.rs # Russian string catalog
│ ├── ipc/ # Inter-process communication
│ │ ├── client.rs # Named pipe IPC client
│ │ └── protocol.rs # Request & response message types (Serde)
│ ├── autorun.rs # Windows Registry autorun integration
│ ├── config.rs # JSON configuration persistence & validation (theme, language, updates)
│ ├── daemon.rs # Daemon entrypoint & service lifecycle
│ ├── gui.rs # GUI entrypoint & eframe application loop
│ ├── i18n.rs # Internationalization loader & language switcher
│ ├── models.rs # Domain data models (Rule, Trigger, Action, Process)
│ ├── sharing.rs # Portable automation compression, encoding & clipboard sharing
│ ├── updater.rs # GitHub releases auto-update & self-replacement engine
│ └── main.rs # CLI dispatcher (--daemon, --gui, default)
├── build.rs # Windows resource compilation (icon, manifest)
├── Cargo.toml # Rust manifest & dependencies
└── LICENSE # MIT License
Configuration and state files are located in:
%LOCALAPPDATA%\ProcessHandler\
| File / Directory | Description |
|---|---|
config.json |
Application settings, user rules, poll interval, window geometry, color theme (dark, light, chocolate), language (english, russian), startup update checks, and autorun state |
Note
Event and action execution logs are maintained in an in-memory ring buffer (up to 500 entries) in RAM, with smart eviction prioritizing rule execution and error history, and streamed via IPC directly to the GUI without incurring disk I/O wear.
This project is licensed under the MIT License.
- UI/UX Idea: ArtCraft Launcher
ProcessHandler interacts directly with Windows system processes and administrative APIs. When configuring process termination or priority rules, ensure critical operating system processes are excluded from automated termination.
For issues, questions, or feature requests, please open an issue on GitHub Issues.
