Standalone Notifier IPC Subsystem
LocalTelemetry.Notifier is a standalone, lightweight WinForms executable (LocalTelemetry.Notifier.exe) targeting .NET 10 Windows x64. It is dedicated to rendering non-blocking desktop toast alert windows.
Why a Standalone Process?
Rendering alert windows with slide-in animations and auto-dismiss timers inside the main application process carries two key risks:
- Focus Stealing: Window activation during full-screen gaming or video playback could cause games to minimize.
- UI Thread Blocking: Animation loops on the main UI thread could delay telemetry sensor polling ticks.
By spinning up LocalTelemetry.Notifier.exe as a secondary process, notifications display smoothly without stealing foreground focus or blocking hardware monitoring threads.
📡 Named Pipe IPC Communication
LocalTelemetry.App launches LocalTelemetry.Notifier.exe passing its Parent Process ID (PID) as args[0]. Inter-process communication takes place over an asynchronous Windows Named Pipe (LocalTelemetryNotifier).
JSON Message Contract (NotificationMessage)
NotificationClient.cs serializes messages over the pipe in UTF-8 JSON Lines format:
{
"Action": "ShowToast",
"Title": "CPU Temperature Warning",
"Body": "CPU reached 91°C (Limit: 90°C)"
}internal sealed record NotificationMessage
{
public string Action { get; set; } = string.Empty;
public string? Title { get; set; }
public string? Body { get; set; }
}Command Actions
ShowToast: TriggersToastFormrendering on screen withTitleandBody.Shutdown: Gracefully cancelsCancellationTokenSourceand closesHiddenForm.
🖥️ Hidden Message Pump (HiddenForm)
Inside Program.cs, an invisible HiddenForm provides a WinForms message pump:
- Hidden from Alt+Tab via
WS_EX_TOOLWINDOW(0x00000080) extended window style. ShowInTaskbar = false,WindowState = Minimized,Opacity = 0.- Receives pipe messages on a background thread (
RunPipeServerAsync) and dispatches toast creation to the UI thread viahiddenForm.BeginInvoke(...).
🎨 Toast Window Rendering & Animation (ToastForm.cs)
ToastForm renders a custom dark alert window:
- Dimensions:
320pxwidth ×90pxheight. - Appearance: Dark background (
Color.FromArgb(32, 32, 32)), rounded corners (CornerRadius = 8viaGraphicsPath), border pen (Color.FromArgb(60, 60, 60)). - Audio Cue: Plays system asterisk sound (
SystemSounds.Asterisk.Play()). - Ease-Out Slide-In Animation:
OnLoadanimates the window position from below the screen working area using a cubic ease-out curve (1.0 - Math.Pow(1.0 - t, 3)) over300ms. - Auto-Dismiss: A
System.Windows.Forms.Timerautomatically closes the toast window after5000ms.
🛡️ Parent Process Monitoring & Auto-Exit
When LocalTelemetry.Notifier.exe receives parentPid as args[0]:
- Launches a background worker task:
Process.GetProcessById(parentPid).WaitForExit(). - When the parent
LocalTelemetry.exeprocess exits, the notifier process automatically logs exit and shuts down cleanly.