Luis Diaz
asked on
AutoHotkey: WinMaximize
Hello experts,
I am trying to understand the logic behind WinMaximize however the documentation available at:
https://www.autohotkey.com /docs/comm ands/WinMa ximize.htm
is not enough for me.
The need is to set a WinActive condition, maximize and send a click:
Like this:
I am trying to understand the logic behind WinMaximize however the documentation available at:
https://www.autohotkey.com
is not enough for me.
The need is to set a WinActive condition, maximize and send a click:
Like this:
If (WinActive("ahk_exe ssms.exe"))
{
WinMaximize
MouseClick, left, 55, 233
Return
}
Else
{
MsgBox,4144,Error,Active window is not a supported program
Return
}
Thank you for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OK, but the WinActivate should not be needed. The only way that you'll get into that logic path is if the WinActive returns True, in which case you certainly don't have to activate it...it's already active!
ASKER
Noted, I will retest without winactivate to see what happens.
I'm sure it will work without it...if not, something wacky is going on!
ASKER
Indeed it works!
Final result:
Final result:
+^F12::
If (WinActive("ahk_exe ssms.exe"))
{
WinMaximize
MouseClick, Right, 800, 125
}
Else
MsgBox,4112,Error,SSMS is not your active windows
Return
Thank you for your help.
Great news! Regards, Joe
ASKER
I tested the following and it works for me.
Open in new window
Thank you very much for your advice.