sarfraznawaz2005/agent-skills-collection
Overview
This skill provides patterns and practical techniques for building advanced AutoHotkey v2 GUIs. It focuses on modern v2 idioms: event-based handlers, Submit-based data retrieval, property-driven visibility, and control optimization. Use it to create responsive windows, complex layouts, and performant control-heavy applications.
How this skill works
The skill demonstrates how to construct GUIs by creating Gui objects, adding controls with named variables, and wiring events via OnEvent instead of legacy g-labels. It shows submitting form data through Gui.Submit(), managing control visibility with properties, using ListView/Tab/ComboBox patterns, and tuning memory or container capacity for large datasets. Examples include modal dialog patterns, dynamic control positioning, and efficient ListView population.
When to use it
- Building multi-tab or multi-control desktop applications with AutoHotkey v2
- Implementing event-driven interactions (Click, Change, DoubleClick) without g-labels
- Handling large datasets in ListView or bulk UI updates while minimizing memory churn
- Creating modal dialogs or background windows that should not steal focus
- Validating ComboBox or Edit inputs and reacting to user changes in real time
Best practices
- Use Ctrl.OnEvent('Event', Handler) for all events; avoid legacy g-label syntax
- Assign v-prefixed variable names to controls and call Gui.Submit() to collect values
- Toggle control visibility via the Visible property (Control.Visible := false/true)
- Pre-allocate Array/Map capacity and use VarSetStrCapacity for large string builds
- Keep event handlers small and retrieve values via Submit or explicit control access
Example use cases
- A settings dialog with Tab control separating options, data paths, and output
- A file browser that populates a ListView and handles DoubleClick to open items
- A form-based tool that collects user inputs with Submit() and validates via OnEvent
- An optimization script that loads thousands of entries into a ListView with pre-sized arrays
- A modal preferences window that prevents interaction with the main application
FAQ
Submit collects named values reliably and is the recommended v2 pattern; direct Text access can bypass variable bindings and misses v-prefixed control variable mapping.
How do I prevent focus stealing when showing background windows?
Use the NoActivate option on Gui.Show or set Gui.Opt('+OwnDialogs') for modal behavior when appropriate.
4 skills
This skill helps you build advanced AutoHotkey v2 GUI applications with event handling, data submission, and performance optimization across complex controls.
This skill helps you create and manage Windows Task Scheduler jobs with prompts, scheduling, and reminders.
This skill captures full-screen or region screenshots on Windows with configurable JPEG quality and scaling to reduce file sizes.
This skill helps you build cross-platform desktop apps with Neutralino.js, using secure APIs, initialization, and window management for practical utilities.