Skip to main content

The problem:

FancyZones is tool from PowerToys).It’s a great free alternative to DisplayFusion for managing windows on Super Ultra-wide Screens.

  • However, one of the problems I’ve been struggling with is that the window goes behind the taskbar. As a result every window appears clip below or behind the taskbar
  • The second problem is that when Chrome is not maximized the tabs don’t reach all the way up and you can’t click from the edge of the screen. When chrome is only resized there’s a padding or border that prevents you from clicking tabs when the cursor is all the way to the top.
    Chrome Maximized:
    enter image description here
    Chrome Resized:
    enter image description here

 

The Solution:

The following is AutoHotkeys script that will solve this problem:

#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%

LRButtonDown = 0

Loop
{
    
    GetKeyState, LButtonState, LButton
    GetKeyState, RButtonState, RButton
    
    if (LButtonState = "D" and RButtonState = "D"){ ; Both mouse buttons are down
            LRButtonDown = 1
    }

    if (LButtonState = "U" and LRButtonDown){ ; Left button is up after both were down
        
        Sleep 100 ; Needed delay for the WinMove to work
        WinGet, last_process, ID, A
        WinMove, ahk_id %last_process%,, Left, -10, Width, A_ScreenHeight-30
        LRButtonDown = 0
    }
    
    Sleep 100 ; Delay loop to minimize CPU usage
}
return

Explanation:

In short, what it does is watch for when both Left and Right mouse buttons are pressed and resizes the last active window to -10 from the top and to +30 from the bottom (ScreenHeight – 30). Left and Width are set back to whatever the window Left and Width were.

Downsides:

  • It only works for full height layouts such as the Priority Grid. Horizontally split layouts won’t work as intended. You can customize the scrip to your needs.
  • It will fire the resize even if you’re not using FancyZones – clicking both mouse buttons will resize the last active window. Could be viewed as a feature rather than a bug 😂

 

Download:

You can find the .AHK script and a precompiled executable below:

Download FanzyZones Fix

 

Other Notes:

  • You can add a shortcut to the .exe or .ahk to your startup folder to start with windows.
    (Win+R -> shell:common startup -> Create Shortcut)
  • A good idea is to disable window snapping (Search for “snap settings” in start menu)
  • Originally, this question was asked on StackOverflow with a bounty without any good answers. It’s the inspiration for finding a solution.

Leave a Reply