Created
August 26, 2021 17:05
-
-
Save aqt/b681c7b59b80fd8df45445dc7d291a39 to your computer and use it in GitHub Desktop.
Firefox disables maximization on popup window types, this autohotkey script re-enables that functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Persistent | |
Gui +LastFound | |
shellMessage(wParam, lParam) { | |
if (wParam = 1) { ; HSHELL_WINDOWCREATED | |
hWnd := lParam | |
WinGetClass, winClass, ahk_id %hWnd% | |
if (winClass = "MozillaDialogClass") { | |
Sleep, 200 ; Quick fix, no effect if too fast | |
WinSet, Style, +0x10000, ahk_id %hWnd% | |
} | |
} | |
} | |
DllCall("RegisterShellHookWindow", UInt, WinExist()) | |
hook := DllCall("RegisterWindowMessage", Str, "SHELLHOOK") | |
OnMessage(hook, "shellMessage") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disclaimer that I'm not at all familiar with WinAPI.
I threw in a sleep because there was no effect if reacting too fast to the "window created" message. There's no particular reason for choosing 200ms, if it doesn't work for you try increasing this value. According to the docs the message is sent when the widow exist, but perhaps style hasn't been set at that time? In which case there might be a better message to listen for. Another possibility is that Firefox manipulates it after creating the window.