Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[center-active-window.ahk] An AutoHotkey script to make WinKey+C center active window #autohotkey #windows
; Courtesy of http://superuser.com/a/403191
^#c::
WinGetTitle, windowName, A
CenterWindow(windowTitleVariable) {
WinGetPos,,, Width, Height, %windowTitleVariable%
WinMove, %windowTitleVariable%,, (A_ScreenWidth - Width) / 2, (A_ScreenHeight - Height) / 2
}
CenterWindow(windowName)
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment