Resize a Program Window to Custom Dimensions using AutoHotkey

Print Page

If you are looking for a utility to resize a program window in Windows, Sizer is a good option. But, if you are already using AutoHotkey, then here is a tiny script that will allow you to resize a program’s window to any custom dimensions you want:

Resize Window

    WinGet, window, ID, A
    InputBox, width, Resize window, Enter width:, , 170, 130
    if (width != "")
        InputBox, height, Resize Window, Enter height:, , 170, 130
    WinMove, ahk_id %window%, , , , width, height

The script is configured to work with Win + = keyboard combo, however, you can change it to anything you like.

How to Use?

  • Focus on the window you’d like to resize
  • Press Win + = key
  • Enter desired width and height
  • Hit OK

Simply drop the code to your master AutoHotkey script file or compile the code as an EXE to carry it anywhere you go.