问题
I have an AutoHotkey script that launches an application maximized like this:
`Run, myprogram.exe,, Max`
It then gets rid of the minimize and restore buttons. I can still click on the task bar and drag downwards to restore the window. Is there any good way to keep my window maximized in AHK? How about just locking the window's position?
回答1:
Does the F11 key maximize the app? When in F11 mode most apps completely lose their title bar.
If so, run the app then send an F11 key (You may need to wait a bit for the app to be active or something).
Failing that, yes you could have an infinite loop running that monitored the window position / size (WinGetPos) and if it was not at 0,0 and the size of the screen (A_ScreenWidth, A_ScreenHeight), then move it to that position and size (WinMove).
来源:https://stackoverflow.com/questions/41877213/keep-window-maximized-with-autohotkey