Maximize a Chrome window that might be minimized

Ask gaming related questions (AHK v1.1 and older)
codude
Posts: 128
Joined: 12 Nov 2015, 05:33

Maximize a Chrome window that might be minimized

23 Apr 2017, 21:25

This works fine for minimizing a Google Chrome window that might be open

WinGet nChromeWindows, Count, ahk_class Chrome_WidgetWin_1
WinMinimize ahk_class Chrome_WidgetWin_1

But this will not work for maximizing a Google Chrome window that might be minimized.

WinGet nChromeWindows, Count, ahk_class Chrome_WidgetWin_1
WinMaximize ahk_class Chrome_WidgetWin_1

What am I doing wrong? Thanks
HappyMajor
Posts: 6
Joined: 07 Mar 2017, 11:59

Re: Maximize a Chrome window that might be minimized

24 Apr 2017, 07:24

Just use "WinActivate, Chrome"
codude
Posts: 128
Joined: 12 Nov 2015, 05:33

Re: Maximize a Chrome window that might be minimized

27 Apr 2017, 23:16

Thanks, I tried that on this screen and it did not work. I minimized this screen and ran "WinActivate, Chrome" and it did not come back up. I did a WinGetTitle on this screen and it did have the word "Chrome" in the window title.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Maximize a Chrome window that might be minimized

28 Apr 2017, 02:02

Try:

Code: Select all

WinRestore, ahk_class Chrome_WidgetWin_1
WinMaximize, ahk_class Chrome_WidgetWin_1
codude
Posts: 128
Joined: 12 Nov 2015, 05:33

Re: Maximize a Chrome window that might be minimized

28 Apr 2017, 07:57

Thanks, this is better but I still have an issue. I am starting to figure out there is a difference between a window being minimized and a window being covered by another window. Your solution works if the Google Chrome window is minimized but if it was covered over by another window it does not work. Is there something I can add to this or change so that the Chrome window is put on top for both cases?
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Maximize a Chrome window that might be minimized

28 Apr 2017, 10:38

You could try:

Code: Select all

WinRestore, ahk_class Chrome_WidgetWin_1
Winactivate, ahk_class Chrome_WidgetWin_1
WinMaximize, ahk_class Chrome_WidgetWin_1
You could also check the state of the window first with:

Code: Select all

WinGet, OutputVar, MinMax, WinTitle
But i dont think its needed.
codude
Posts: 128
Joined: 12 Nov 2015, 05:33

Re: Maximize a Chrome window that might be minimized

28 Apr 2017, 11:32

That did it!! Perfect. Thank you

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 70 guests