AutoHotkey script for automatic windowed-fullscreen on a specific app -
here's i'm @ :
#noenv ; recommended performance , compatibility future autohotkey releases. sendmode input ; recommended new scripts due superior speed , reliability. setworkingdir %a_scriptdir% ; ensures consistent starting directory. settitlematchmode, 3 loop { ; apparently loop recommended app-as-a-trigger. send, ^!a winget, p_exe, processname, forged alliance, style, style, { if(style & 0xc40000) { winset, style, -0xc40000, winmaximize, } sleep, 100 } } return
obviously i'm trying make when forgedalliance.exe runs it's window borders removed , maximised.
i had working script triggered hotkey :
lwin & f:: winget style, style, if(style & 0xc40000) { winset, style, -0xc40000, winmaximize, } else { winset, style, +0xc40000, winrestore, } return
and wish triggered app running.
i tried :
if processexist("forgedalliance.exe") { } return
but did not work, condition returned true (always executed code) though fa not running @ targeted mouse hovered.
what correct way go this?
from description, sounds you're putting loop inside of process check. means check once. here better solution uses timer.
#persistent procname := "forgedalliance.exe" settimer, checkproc, 2000 return checkproc: if (!processexist(procname)) return winget style, style, % "ahk_exe " procname if (style & 0xc40000) { winset, style, -0xc40000, % "ahk_exe " procname winmaximize, % "ahk_exe " procname } return processexist(exename) { process, exist, %exename% return !!errorlevel }