for example:
Code: Select all
^!a::
winmove, ahk_class Notepad,, -20, -15, 1970, 1100
winrestore can be used to avoid this problem but it activates even minimized window first then do the winmove, not what I want.
any thoughts would be appreciated.
Code: Select all
^!a::
winmove, ahk_class Notepad,, -20, -15, 1970, 1100
Code: Select all
^!a::
WinGet, WinState , MinMax, ahk_class Notepad
if (WinState = 1)
{
winrestore, ahk_class Notepad
winmove, ahk_class Notepad,, -20, -15, 1970, 1100
}
else
winmove, ahk_class Notepad,, -20, -15, 1970, 1100
return
Code: Select all
^T::
Resize("ahk_exe notepad.exe" , 1990, 80, 680, 860) ; <-- Added X & Y.
; Resize("ahk_exe firefox.exe", , , 3850, 2025)
; Resize("ahk_exe thunderbird.exe" , , , 2900, 1600)
Return
;------------------------
Resize(WinTitle, Xpos, Ypos, Width, Height) { ; <-- Added Xpos & Ypos.
WinGet Win, List, % WinTitle
If (Win > 0) {
Loop % Win { ; Loop through all matching Windows for this WinTitle
WinRestore % W := "ahk_id" Win%A_Index%
WinMove % W,, Xpos, Ypos, Width, Height ; <-- Added Xpos & Ypos.
}
MsgBox 64, Resized, % "Resized to " Width " x " Height ":`n`n" WinTitle
} Else {
Soundbeep, 800, 200
MsgBox 48, Error, % "Window was not found.`n`n" winTitle
}
}
Return
^Home::
Reload
Return
^Esc::
ExitApp
Return