I use this script to minimize the topmost open window with the shortcut ctrl+space: WinMinimize, A
Is it possible to maximize it again using the same command?
I mean : ctrl+space - 1st instance - minimize the topmost open window and
ctrl+space - 2nd instance - maximize the same window
Minimize and again Maximize the same window
Something like this?
Code: Select all
If not WinTitle
{
WinGetActiveTitle, WinTitle
WinMinimize, A
}
else
{
WinRestore, % WinTitle
WinActivate, % WinTitle
WinTitle:=""
}
returnI pasted the above code in Fastkeys short cut Ctrl+space.
I opened the browser and then I opened the notepad. I pressed the above short cut (Ctrl+space) and the notepad window got minimized. I again pressed the same short cut, but this time the notepad didn't return to its original position.
I opened the browser and then I opened the notepad. I pressed the above short cut (Ctrl+space) and the notepad window got minimized. I again pressed the same short cut, but this time the notepad didn't return to its original position.
You need to make sure the window is actually active, click on the header to be sure. Also try this:
Code: Select all
If not WindowID
{
WinGet WindowID, ID, A
WinMinimize, ahk_id %WindowID%
}
else
{
WinActivate, ahk_id %WindowID%
WinRestore, ahk_id %WindowID%
WindowID:=""
}
return