Skip to content

Instantly share code, notes, and snippets.

@straef
straef / AutoHotKey.ahk
Last active September 4, 2021 21:51
AutoHotKey Simple Center
; centers current window without changing dimensions by pressing win + alt + up-arrow
#!Up::CenterActiveWindow()
CenterActiveWindow()
{
; Get the window handle from active window
winHandle := WinExist("A")
; Get the current monitor from the active window handle
VarSetCapacity(monitorInfo, 40)
NumPut(40, monitorInfo)