2019-06-17 07:54:48

I wasn't sure if this belonged here or in the developer room, since it does involve a scripting question. I'm creating hotkey assignments for various programs using AutoHotKey, and I want my scripts to also make sure that the newly launched program is maximized. I've tried reading over the instructions for scripting, but for the life of me I just don't get how to accomplish the window maximizing (most likely because I'm a particularly bad programmer/scripter). I also would've asked this question of the AutoHotKey forums, but unfortunately they use those nasty capsha things for account creation and they set up an admin address for blind people to be helped in creating accounts, but I never got a response. sad If anybody around here uses AutoHotKey, I'd greatly appreciate any help you can offer in figuring out this. Thanks in advance.

AKA president731

2019-06-17 14:49:21

Hi,
To maximize a window, Just use "WinMaximize".
It uses "last_found_window", So you may omit the title or text parameters.
I bring up an example here:

Run, notepad.exe
; Runs notepad.exe in order to open notepad.
WinWait, Untitled - Notepad
; Waits untill a window named "Untitled - Notepad" opens up.
WinMaximize
; It maximizes the last found window by the script which is "Untitled - Notepad" so i just omitted the title and text parameters
; Or, You may specify other parameters to ensure you're maximizing your desired window and not anything else. Like this:
WinMaximize, Untitled - Notepad
; This one purticularly maximizes the window called "Untitled - Notepad" so you don't have to worry about what's stored in your "last_found_window" variable.

Hope it helps

Co-founder of Sonorous Arts.
Check out Sonorous Arts on GitHub: https://github.com/sonorous-arts/

2019-06-20 04:37:14

@Reza.jdp, thanks, that definitely makes sense! I haven't had a chance yet to give it a try, but I'll post back when I have.

AKA president731