I've already written a test tool in order to localize the problem.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
gui,1:Default
w:=A_ScreenWidth-50
h:=A_ScreenHeight-200
gui,add,button,w200 h30, A button of a big window
gui,show, x15 y15 w%w% h%h%, GUI 1 Big
gui,2:Default
gui,add,button,w200 h30, OK
gui,show, x30 y10 w220 h50, GUI 2
gui,3:Default
gui,add,text,w200 , some Text
gui,+hwndGUI2HWND
gui,show,,GUI 3
WinMove,ahk_id %GUI2HWND%,,30,140,220, 100
gui,4:default
gui,add,button,,a button
gui,show,,GUI 4
WinMove,GUI 4,,30,350
gui,5:default
gui,add,text,w200 , some Text
gui,add,button,w300 h100,a button
gui,show,,GUI 5
return
1guiclose:
2guiclose:
3guiclose:
4guiclose:
5guiclose:
ExitApp
This is how it looks on my computer:
This are the results of my analysis:
GUI 4 and 5 are same size in both pictures. The sizes of the GUIs were not specified in the script.
GUI 1, 2 and 3 have wrong size. The sizes of the GUIs were either set on creation or they were moved. Although the sizes of GUIs 2 and 3 were set to a specific value, they are not correct. GUI 1 was set to be almost screen-filling, depending of a_screenheight and a_screenwidth. Althoug the values in those build in variables are correct (already tested in an other test script), the GUI becomes too big.
What may be the reason and solution?