How can I maximize a window across multiple monitors?

前端 未结 3 687
长情又很酷
长情又很酷 2021-02-02 14:39

Using AutoHotkey, How can I bind a hotkey to stretch/maximize/span a window across multiple monitors so that it covers both displays?

Right now, I have to do this by man

3条回答
  •  我在风中等你
    2021-02-02 15:20

    I have two monitors at work and at home with my task bar on the left so I needed to tweak this script to ensure it moved the window correctly.

    +#Up::
        WinGetActiveTitle, Title
        WinRestore, %Title%
       SysGet, Mon1, MonitorWorkArea, 1 
       SysGet, Mon2, MonitorWorkArea, 2 
       Monitor1Width := Mon1Right - Mon1Left
       Monitor2Width := Mon2Right - Mon2Left
       MonitorsWidth := Monitor1Width + Monitor2Width
       SysGet, Height, 79
       WinMove, %Title%,, %Mon1Left%, %Mon1Top%, %MonitorsWidth%, %Mon2Bottom%
    return
    
    +#Down::
        WinGetActiveTitle, Title
        WinRestore, %Title%
       SysGet, Mon2, MonitorWorkArea, 1
       Monitor1Width := Mon2Right - Mon2Left
       WinMove, %Title%,, %Mon2Left%, %Mon2Top%, %Monitor1Width%, %Mon2Bottom%
    return
    

提交回复
热议问题