Copedal

Building & integrations

Desktop tool builder

Small Windows tools with global hotkeys, tray behaviour and a repeatable check.

Paid $9 list, $7 until 2026-12-31 · one skill, yours for good. The outline, the steps and the file open after purchase.

desktop-tool-builder 70 lines · 7 KB

Background

The value of a small tool is not in the capability call but in few entry points, a clear state, and not interfering with what the user is doing. 80% of rework comes from these three things, not from the business logic.

The screen-recording tool is the reference implementation of this skeleton: swap in screen capture, colour picking, OCR or file tidying and the skeleton does not change — only the "capability layer" does (ffmpeg pipeline, region selector, output format).

Why it is built this way

Stage S2 fixes the naming rule, the config fields and the run state files before a panel exists. The rule carries placeholders, so starting a recording writes a base name with the {dur} segment removed plus a _recording suffix, and stopping re-renders the final name from the same metadata: start time, region, resolution, duration. That is why a stop cannot append a second duration, and why a name clash is settled with _2 and _3 at rename time instead of at capture time.

Merging the desktop shortcuts is what pushes the hotkey into the resident process. One .lnk cannot carry two hotkeys, so agent.ps1 registers them with RegisterHotKey and starts with the system. toggle.ps1 and copy.ps1 only write a command file under run\ and wait for the agent, which is how the panel, the tray icon and the hotkey share a single command channel. A clickable floating layer must not use ShowDialog, since modality disables the other windows on the same thread, so the pump is a DoEvents loop.

Where it bites

  • 1409 after deleting the old shortcut After the old .lnk is deleted, the agent's RegisterHotKey keeps failing with Win32 error 1409, because Explorer still holds the deleted shortcut's hotkey until it reloads. Restarting explorer.exe clears it at the cost of the open file windows, and a different key pair also works. Probing RegisterHotKey from outside is how 1409 is confirmed.
  • Buttons that can be seen but not clicked A mask shown with ShowDialog is modal and disables the other windows on the same thread, the form holding the buttons included. A full-screen mask also dims those buttons and swallows the clicks unless its Region has holes cut to the buttons' own rounded shape, or the four corners show white.
  • The red dot inside the video gdigrab records the desktop composite, so any top-level window above it lands in the file, indicator included. SetWindowDisplayAffinity with WDA_EXCLUDEFROMCAPTURE, 0x11, keeps the dot and the border out. The same setting makes screenshot APIs miss them as well, which is why IsWindowVisible plus the rectangle is used to prove they are on screen.
  • A file name with the duration twice Stopping against a rule that still contains {dur} appends a second duration, and a rename that runs before ffmpeg releases the handle leaves a _recording file behind. One metadata set feeds both names, and the rename retries Move-Item for about 3 seconds, keeping the temporary name and logging it when the retry fails.

This part is for buyers

The outline, the steps and the SKILL.md stay closed until this address owns the skill.

$9 early bird $7 until 2026-12-31

Buy this skill

Checkout opens soon — leave your address and we will tell you when it does.

all 28 skills for $149, list $430

When to use it

Build or rework small Windows desktop tools (PowerShell + WinForms, with a screen-recording tool as the reference implementation): merging desktop shortcuts, global hotkeys, a resident agent and control panel, tray icon, file naming and save directory, overlay indicators that stay out of captures, launch at startup, and repeatable verification. Use to create such a tool or to fix a dead hotkey, a panel that cannot be clicked, a floating layer that blocks operations, or indicator elements that end up recorded in the video. Not for general video editing, subtitle production or platform publishing.