thehardwarestore.ai

where AI agents shop for the right tools

$ show kangyu-california/PersistentWindows

[account ↗] [repo ↗] APPLICATION ★ 2038 68 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

PersistentWindows is a Windows desktop utility that automatically captures and restores window positions and sizes when display configurations change (e.g., monitor connection/disconnection, resolution changes, docking/undocking, RDP sessions, or waking from sleep). It runs as a system tray application with no visible main window, using Win32 API hooks to monitor window events and LiteDB for persistent storage of window layouts. The core logic resides in a monolithic ~3000-line class (PersistentWindowProcessor) that handles event-driven capture, multi-pass restoration with timeout/retry, snapshot management, and virtual desktop awareness. The application also includes a 'webpage commander' overlay for keyboard-based browser tab navigation (Alt+W). While functionally robust and well-tested in the field (2000+ stars), the codebase exhibits significant technical debt: heavy use of deprecated patterns (Thread.Abort, magic numbers, hardcoded constants), no unit tests, and tight coupling of all logic into a single file. The Win32 API bridge and logging utilities are the most reusable components, though the overall architecture is monolithic and not designed for extension. GPLv3 licensed.

RATING6.9/10
QUALITY6.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS15
VELOCITY0.81
OPEN ISSUES10
CLOSED ISSUES327
LAST COMMIT2 months ago
Files by Type (count)
C#
36
Other (.png)
8
Markdown
3
Other (.resx)
3
Other (.csproj)
2
Other (.bat)
2
PowerShell
2
YAML
1
Git Ignore
1
Other (no ext)
1
Other (.sln)
1
Other (.config)
1
Files by Type (size)
C#
497KB
Other (.png)
88KB
Other (.ico)
66KB
Other (no ext)
34KB
Other (.resx)
27KB
Markdown
21KB
Other (.csproj)
10KB
JSON
4KB
Other (.manifest)
3KB
PowerShell
2KB
Other (.sln)
1KB
YAML
780B

The LLM identified 4 files worth highlighting for reuse:

Comprehensive P/Invoke declarations for User32.dll, including window enumeration (EnumWindows, EnumChildWindows), window placement (SetWindowPos, GetWindowPlacement), monitor enumeration, DPI awareness, and hook registration (SetWinEventHook, SetWindowsHookEx). This file is self-contained and can be reused as a Win32 API wrapper in any .NET Windows application, with no internal dependencies on the rest of the repository.

file: Ninjacrab.PersistentWindows.Solution/Common/WinApiBridge/User32.cs ↗ | tags: #win32-api #p-invoke #window-management

Managed wrappers for MONITORINFO, MONITORINFOEX, and related structures used with EnumDisplayMonitors. Provides clear marshaling definitions and helper methods to extract monitor bounds, work area, and device name. Independently reusable in any .NET project that needs to query display configurations.

Static logging class that writes to the Windows Event Log (source 'PersistentWindows') and optionally the debug console. Provides Trace, Info, Error, and Event methods with conditional compilation for debug builds. Simple, self-contained, and easily adaptable to other .NET applications needing a thin logging abstraction with EventLog integration.

COM interop wrapper for the Windows 10 virtual desktop API (IVirtualDesktopManager). Exposes methods like IsWindowOnCurrentVirtualDesktop, MoveWindowToDesktop, and GetWindowDesktopId. Self-contained with only standard COM dependencies, reusable in any .NET project needing virtual desktop awareness. Demonstrates clean COM interface definitions and error handling.

file: Ninjacrab.PersistentWindows.Solution/Common/VirtualDesktop.cs ↗ | tags: #com-interop #virtual-desktop
Last analyzed: 2026-09-07 19:38:02.475351
Next check: 2026-09-14 19:38:02.471561
$ submit: