An AutoHotkey v2 script that snaps windows to a 9-point grid across multiple monitors, with intelligent handling of various taskbar configurations.
| Hotkey | Action |
|---|---|
Ctrl+Shift+Win+S |
Center |
Ctrl+Shift+Win+W |
Top center |
Ctrl+Shift+Win+X |
Bottom center |
Ctrl+Shift+Win+A |
Left center |
Ctrl+Shift+Win+D |
Right center |
Ctrl+Shift+Win+Q |
Top-left |
Ctrl+Shift+Win+E |
Top-right |
Ctrl+Shift+Win+Z |
Bottom-left |
Ctrl+Shift+Win+C |
Bottom-right |
- Standard Windows taskbar — full multi-monitor support
- SmartTaskbar — detects when taskbar is hidden and adjusts work area accordingly
- Windhawk — taskbar-auto-hide-when-maximized — reads the
primaryMonitorOnlysetting; secondary monitors using native auto-hide have their full screen height restored - Windhawk — taskbar-on-top — reads per-monitor
taskbarLocationandtaskbarLocationSecondaryregistry settings and adjusts top/bottom boundaries per monitor accordingly
Edit config.ini (copy from config.example.ini if it doesn't exist):
[Settings]
# Pixels between window bottom and taskbar (0 = flush against taskbar)
TASKBAR_GAP=0
# Optional extra inset from all screen edges in pixels (0 = flush; per-app DWM frame bleed is handled automatically)
SCREEN_EDGE_MARGIN=0- AutoHotkey v2
- Windows 10/11
- Install AutoHotkey v2
- Clone or download the repository
- Copy
config.example.initoconfig.iniand adjust settings as needed - Run
WindowSnapGrid.ahk, or add it to your startup folder