Is possible to 'force' a window to a given dimension?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
fabricio234
Posts: 122
Joined: 06 Mar 2020, 21:48

Is possible to 'force' a window to a given dimension?

Post by fabricio234 » 02 Jun 2022, 15:41

I don't understand why but sometimes my target window doesn't resize to the width and height I input
it 'stuck' in the correct width however the height is like 200px smaller

when this happens I can call WinMove/MoveWindow infinitely and it doesn't resize to the desired input
then i need to move it to a different width/height and try again with the desired input :wtf:

i need to reproduce these steps of changing to a different width / trying to set to the desired width until it works

does someone else has experienced this issue?

I tried resizing the window with WinMove and MoveWindow and this happens randomly with both

Code: Select all

WinMove, ahk_id %hWnd%,,,, 1000, 500
DllCall("MoveWindow", UInt, hWnd, UInt, X, UInt, Y, UInt
   , 1000, UInt, 500, Int, 1)

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Is possible to 'force' a window to a given dimension?

Post by mikeyww » 04 Jun 2022, 00:22

Does it work if you try to resize a Notepad window?

ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: Is possible to 'force' a window to a given dimension?

Post by ananthuthilakan » 04 Jun 2022, 01:15

Code: Select all

 WinGet, WinStatus, MinMax, ahk_exe chrome.exe
if (WinStatus != 0)
	WinRestore, ahk_exe chrome.exe
WinMove, ahk_exe chrome.exe,, 12, 438, 1190, 594 ; x,y,width,height


Post Reply

Return to “Ask for Help (v1)”