Anyway, normally, when you run a program, it's possible to control its window from the executing program. In the command-line, you can use start /min notepad to run Notepad minimized, or in AHK, you can use Run,notepad,,hide to run it hidden. You can also set the Run field in a Windows shortcut.
This does not seem to work for AHK GUI programs. This simple script creates a GUI with an edit box. It defaults to making the window just big enough for the edit-box:
Code: Select all
gui,add,edit,w100 h100
gui,+resize
gui,show
I checked the docs to see if there's some sort of A_ variable to deal with this, but there doesn't seem to be one.
Yes, there are workarounds, but they shouldn't be necessary. Most programs behave correctly without having to jump through hoops.
The easiest way to fix this would be to just expose nShowCmd that the AHK executable receives in its WinMain() from the program that ran it, for example, as the A_ variable A_ShowCmd, then the script can adjust the GUI as necessary.
[Mod action: Moved topic from "Bug Reports"]