Skip to content

Instantly share code, notes, and snippets.

@fardjad
Last active June 29, 2021 03:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fardjad/a4813ab815d2841264ed to your computer and use it in GitHub Desktop.
Save fardjad/a4813ab815d2841264ed to your computer and use it in GitHub Desktop.
[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