Dann mache die Überprüfung innerhalb der Schleife:
[autoit]
ShellExecute("notepad.exe")
HotKeySet('!.', '_Close')
[/autoit][autoit][/autoit][autoit]While ProcessExists("notepad.exe")
sleep(100)
WEnd
Func _Close()
ProcessClose("notepad.exe")
EndFunc