跪拜 Guibai
← All articles
Backend

A Windows Desktop Where Icons Clock Out, Fight, and Play Soccer on Their Own

By 努力的小雨 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The project is a worked example of AI-assisted development where the model's value isn't one-shot code generation but sustained, multi-turn refinement driven by runtime feedback. The Windows transparency, foreground detection, and DPI pitfalls it hits are the same ones any desktop-tool author faces, making the debugging narrative more instructive than the final toy.

Summary

Desktop After Hours scans a user's actual `.lnk` files and spawns animated avatars on a click-through WPF stage. The avatars wander, rest, form relationships, and trigger automatic events—chats, cartoon fights, group dances, parades, and full-roster soccer matches—all without user input beyond an optional "mediate" button. The real desktop shortcuts stay untouched; the overlay hides when any normal application is in the foreground and resumes when the desktop is visible again.

The project started as a single-sentence brainstorm handed to Doubao-Seed-Evolving, which proposed the critical architectural decision to clone icons rather than move native ones. The developer then spent most of the effort on product boundaries—rejecting gamified interactions in favor of a pure ambient toy—and on Windows-specific hurdles like mouse transparency, foreground detection that misidentified companion apps, and a default lineup that initially dumped all 38 shortcuts onto the stage.

Every fix came from running the program on real Windows, capturing the failure, and feeding the concrete result back to the model. The final stack is plain C#, .NET 10, WPF, and Win32 interop, with a separate Core library that lets event rules and cooldowns be unit-tested without waiting for desktop animations.

Takeaways
Doubao-Seed-Evolving is a continuously updated latest branch for Coding and Agent scenarios, accessed through a single endpoint that strengthens weekly without model-version churn.
The 1M context window lets the model ingest larger repos and longer requirements in one pass; improved long-horizon capability helps it maintain goals across multi-turn tool calls and edits.
Moving real Windows shortcuts was rejected because it risks destroying the user's desktop layout and can accidentally trigger double-click execution.
The chosen approach clones `.lnk` icons into a transparent WPF overlay, leaving the original shortcuts untouched and the overlay dismissible on exit.
A click-through stage requires `WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE` so the window ignores mouse input, stays out of Alt+Tab, and never steals focus.
Foreground detection initially broke when a desktop companion app (SpeedBall) briefly became the foreground window after the control panel hid, pausing the entire stage.
The first run placed all 38 scanned shortcuts on stage; the fix defaulted to 10 and preserved user-curated lineups across upgrades.
Automatic events use a weighted random roll with cooldowns so the same pair doesn't chat or fight back-to-back, and only one multi-character event runs at a time.
Soccer was changed from a subset of players to the full current lineup, with odd-numbered teams differing by at most one player so nobody is left out.
Rendering was capped at 24 FPS with object reuse because 60 FPS continuous brush and transform allocation was wasteful for a desktop ambient toy.
The development workflow was: brainstorm → requirements plan → development plan → cross-check plans → minimal transparent-stage prototype → feature implementation → runtime testing → fix → repackage → tests → SHA-256.
The project uses only C#, .NET 10, WPF, Win32/Shell COM, JSON, and xUnit—no Unity, Electron, or model SDK.
All data stays local in `%LocalAppData%\DesktopAfterHours`; the tool reads no chat logs, browsing history, or documents, and sends nothing out.
Conclusions

The most consequential decision was product-boundary work, not technical architecture: rejecting click-to-play game mechanics kept the project scoped as an ambient toy rather than a half-baked game nobody asked for.

AI-generated first drafts still miss real-world edge cases—hidden-panel foreground switching, default-full-lineup clutter, stale UI text—that only surface when the binary runs on actual Windows with other software present.

The model's sustained usefulness came from accepting concrete runtime feedback (screenshots plus error descriptions) and producing targeted fixes, not from generating a complete app in one shot.

Separating event rules into a unit-testable Core library let soccer participation and mediation logic be verified without waiting for desktop animations, a structural choice that paid off as rules grew more complex.

Lowering the render rate to 24 FPS and reusing visual objects is a reminder that desktop toys don't need game-engine framerates; the optimization is obvious in hindsight but easy to skip when chasing smooth animation.

Concepts & terms
Doubao-Seed-Evolving
A continuously updated latest branch of the Doubao Seed model family, aimed at Coding and Agent use cases. It provides a stable endpoint whose underlying capabilities improve weekly, removing the need to track discrete model versions.
WS_EX_TRANSPARENT
A Windows extended window style that makes a window click-through: mouse events pass through it to whatever lies beneath. Essential for overlay tools that must not block interaction with the desktop or other applications.
WPF transparent stage
A WPF window configured with layered styles and Win32 interop so it renders animated content on the desktop without capturing mouse input, appearing in Alt+Tab, or stealing focus from other windows.
Foreground window detection for desktop companions
The logic that determines whether the Windows desktop is the active foreground window. It must distinguish Explorer.exe from companion apps like Rainmeter or SpeedBall that also sit on the desktop, or the overlay will incorrectly hide when a companion app gains focus.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗