You can start Windows programs minimized/maximized/hidden from outside the program. For example, from the command-line with start /max notepad or by setting the Run field for a shortcut in its Properties dialog. AutoHotkey also supports starting programs min/max/hidden with the Run command.
But how can an AutoHotkey script/program that has a GUI support this?
Here's a simple sample script:
gui,add,edit,w100 h100
gui,+resize
gui,show
Running the script will show a resizable window just big enough for the edit-control.
Running the script with start /max or any other method does NOT start it maximized (it doesn't matter if the script is compiled or not, it's the same result).
(Yes, it's possible to manually maximize the window or do it from the script, but that's not the goal. The goal is to have the GUI default to some size, but allow users to override it, like with other Windows programs.)
Does AutoHotkey support nShowCmd in WinMain? There don't seem to be any A_ variables that contain it.
What's the solution?
My approach would be something like this:
Then you can:
Or
Or
The argument dont need to be complete, if it contains "max", "min" or "hid" in it, it will work