AHK v2 adding invisible borders not present in AHK v1

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
8minus1
Posts: 8
Joined: 01 Jan 2023, 12:48

AHK v2 adding invisible borders not present in AHK v1

Post by 8minus1 » 16 Apr 2023, 05:33

I create exactly the same GUI in AHK v1 and AHK v2, but in AHK v2, invisible borders are added.
Windows created by CreateWindowEx also appear to be affected.

The invisible borders are 5 pixels thick.
You can see this clearly when you use WinMove to set them to the same dimensions.

Another difference is that in AHK v2, the title bar is taller.

How can I get rid of the invisible borders and fix the title bar, to make the GUI look like it did in AHK v1? Thanks.

Code: Select all

; AHK v1 demo GUI:
Gui, Show, w300 h300
WinGetPos, X, Y, W, H, % A_ScriptName
MsgBox, % W " " H ; 306 329
WinMove, % A_ScriptName,, 300, 300, 300, 300
return

; AHK v2 demo GUI:
Gui().Show("w300 h300")
WinGetPos(&X, &Y, &W, &H, A_ScriptName)
MsgBox(W " " H) ; 316 339
WinMove(300, 300, 300, 300, A_ScriptName)
return

Return to “Ask for Help (v2)”