#HotIf WinActive("ahk_exe aaa.exe")
func()
#HotIf WinActive("ahk_exe bbb.exe")
func()

みたいにすると安定する