AHK still thinks window is maximized

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
KilliK
Posts: 255
Joined: 10 Mar 2016, 21:19

AHK still thinks window is maximized

23 Mar 2018, 15:54

Hello.

My monito's native resolution is 2K and it's the one I am using for almost all my games.
But sometimes there are games which I need to play in a lower fullscreen resolution, ie 1080p.
When I exit those games, the windows which I had already opened before I started the game, appear out of place and smaller. something like this:

Image

I read in the web that this is a common behavior from Windows, they change the desktop resolution when you change the in-game fullscreen resolution and this affects the position of the opened windows.

Now here is the problem with AHK. It still thinks that the windows are maximized and the WinMaximize command wont maximized them. Which is normal since the WinGet minmax command shows that the window is indeed maximized.
My question is how can I fix this? How can I make AHK to realize that the window is not actually maximized in such situations, and force it to maximize and cover the entire monitor as it should be?
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: AHK still thinks window is maximized

23 Mar 2018, 16:38

Use WinRestore before trying to minimize/maximize.

HTH
User avatar
KilliK
Posts: 255
Joined: 10 Mar 2016, 21:19

Re: AHK still thinks window is maximized

23 Mar 2018, 21:08

thanks that did it but how can I trigger the command when this happens? the WinGet is not reliable since the window still has the maximized flag.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: AHK still thinks window is maximized

23 Mar 2018, 21:14

Could use WinGetPos to check width/height and then act on it.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: AHK still thinks window is maximized

24 Mar 2018, 00:08

A window's minimized or maximized state is independent from its size. AutoHotkey tells you the window is maximized because the window really is in that state, which is also reflected by the maximize/restore button showing the icon for restore, not maximize, and restoring the window when clicked.

If you want to detect whether the window fills the screen, WinGetPos is the correct choice. If you just want to make it fill a certain area (or the whole screen), you can just use WinMove, leaving it in the maximized state.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Theda and 137 guests