Skip to content

About

Lightweight, reactive Windows process automation & system monitoring suite.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ProcessHandler Logo

ProcessHandler

Lightweight, reactive Windows process automation & system monitoring suite

License: MIT Platform Rust egui


πŸ“– Overview

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:

  1. System Tray Daemon: An ultra-low overhead background service that listens reactively to Windows WMI process lifecycle events, manages schedules, and executes automated rule pipelines with zero window baggage.
  2. Interactive Desktop GUI: A hardware-accelerated, high-DPI desktop interface powered by egui and eframe, 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).


✨ Key Features

  • Instant process lifecycle detection via native Windows WMI event notifications and low-latency snapshotting
  • Flexible multi-action pipeline combining process control, PowerShell/CMD scripts, webhooks, and delays
  • Deep Windows audio control covering per-process volume/mute, master sound, and microphone devices (WASAPI)
  • Comprehensive trigger engine spanning process events, scheduled timers, user idle states, and system power transitions
  • 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 running duration (exact match, wildcards, regex).
    • Schedules & Alarms: Fixed intervals, daily recurring schedules, and one-shot date/time alarms.
    • System & Power Events: User idle/active state, session lock/unlock, system sleep/wake, and AC/battery power transitions.
  • Action Pipelines:
    • Process Management: Launch applications (custom arguments, working directory, admin rights, hidden mode), terminate process trees, or restart.
    • Audio & Microphone Control: Control master volume, per-application audio sessions (WASAPI mute/volume), and microphone recording endpoints.
    • PowerShell & CMD Scripts: Execute custom scripts and CLI commands with an integrated syntax-highlighting editor.
    • Alerts & Webhooks: Native Windows toast notifications and outbound HTTP REST webhooks (POST/GET/PUT).
    • Flow & System: Screen locking and configurable pause intervals between steps.
  • Execution & Safeguards:
    • Non-blocking asynchronous task execution ensuring the daemon and UI never freeze.
    • Cooldown timers, execution counters, rule cloning, and pause toggles.
    • 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.
  • 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 highlighting, automatic target process icon detection, and builder draft preservation.
  • Action Catalog & Process Picker: Fast in-context modal dialogs to browse available actions and select active processes without losing editor state.
  • Activity Feed: Real-time diagnostic logs capturing trigger evaluations, action outputs, and system events.

πŸš€ Installation

For End Users

Prerequisites

  • 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.)


For Developers

Development Setup

Prerequisites

  • Rust (1.75+ recommended, MSVC toolchain)

Build & Run Commands

# 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 --release

The compiled binary will be located at target\release\ProcessHandler.exe.


πŸ› οΈ Tech Stack

Frontend / UI

  • egui (Immediate-mode GUI engine)
  • eframe (Desktop windowing & rendering integration)
  • Custom Design Tokens & Themes (Dark, Light, Chocolate palettes)
  • i18n Localization Engine (Full English & Russian support)
  • Script Syntax Highlighter (PowerShell & Batch lexer)
  • Win32 Shell GDI & image crate (Native icon rasterization, PNG/JPEG decoding & textures)
  • arboard (Cross-platform system clipboard integration)
  • Named Pipe Client (Thread-safe IPC client)

Backend / Engine

  • Rust (High-performance, memory-safe systems language)
  • Tokio (Asynchronous runtime for decoupled rule execution & IPC)
  • windows-rs (Official Win32, COM & Core Audio bindings)
  • WMI (Windows Management Instrumentation event listener)
  • Core Audio & WASAPI (System volume & per-process)
  • reqwest (Async HTTP client for GitHub releases & binary updates)
  • Named Pipes Server (Multi-client background IPC listener)
  • Serde + Serde JSON (Strongly-typed state persistence)
  • flate2 & Base64 (Zlib compression for portable rule sharing payloads)
  • Windows Registry API (System autorun persistence)

πŸ“‚ Project Structure

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, Master/Mic/Process Audio, Toast, Commands)
β”‚   β”‚   β”œβ”€β”€ engine.rs                 # Central automation state engine & rule evaluator
β”‚   β”‚   β”œβ”€β”€ ipc_server.rs             # Named pipe listener & connection worker
β”‚   β”‚   β”œβ”€β”€ 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
β”‚   β”œβ”€β”€ gui/                          # egui desktop user interface
β”‚   β”‚   β”œβ”€β”€ components/               # UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ icons.rs              # Win32 shell icon extractor, image loader & texture cache
β”‚   β”‚   β”‚   β”œβ”€β”€ script_highlighter.rs # PowerShell & Batch 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
β”‚   β”‚   β”‚   β”œβ”€β”€ changelog_modal.rs    # GitHub release notes & changelog viewer
β”‚   β”‚   β”‚   β”œβ”€β”€ header_bar.rs         # Custom window titlebar & controls
β”‚   β”‚   β”‚   β”œβ”€β”€ inspector.rs          # Rule inspector, trigger & action editor (drag-and-drop)
β”‚   β”‚   β”‚   β”œβ”€β”€ logs_view.rs          # Real-time event & action logs
β”‚   β”‚   β”‚   β”œβ”€β”€ 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
β”‚   β”‚   β”‚   └── settings_view.rs      # Balanced 2x2 settings (System, Engine, Appearance, Updates)
β”‚   β”‚   β”œβ”€β”€ 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

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 100 entries) in RAM and streamed via IPC directly to the GUI without incurring disk I/O wear.


πŸ“„ License

This project is licensed under the MIT License.


πŸ™ Credits


⚠️ Disclaimer

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.


πŸ’¬ Support & Contributing

For issues, questions, or feature requests, please open an issue on GitHub Issues.


About

Lightweight, reactive Windows process automation & system monitoring suite.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages