WinSetTitle breaks #SingleInstance Force
Posted: 26 Sep 2017, 01:07
Renaming the script's own window, even to the same name it's normally given by AHK, causes #SingleInstance Force to no longer work
Let's help each other out
WinGetTitle, vWinTitle, % "ahk_id " A_ScriptHwnd
WinSetTitle , % "ahk_id " A_ScriptHwnd,, % vWinTitle "x" ;modify title
WinSetTitle , % "ahk_id " A_ScriptHwnd,, % vWinTitle ;restore title
#SingleInstance, Forcehad a reason to change the main window's title as yet.
to the docs.You must not change the title of the script's hidden main window if you want to prevent new instances of the script from being launched.