Das dauert hier länger als 1 Sekunde bis der Beep endlich endet.
Code: Select all
q::
FileDelete, Beep.ahk
FileAppend, #NoTrayIcon`nSoundBeep`,1000`,1.E6+0, Beep.ahk
Run, Beep.ahk,,, PID
KeyWait, q
Process, Close ,% PID
Return
w::
Shell := ComObjCreate("WScript.Shell")
Exec := Shell.Exec("AutoHotkey.exe /ErrorStdOut *")
Exec.StdIn.Write("#NoTrayIcon`nSoundBeep,1000,1.E6+0")
Exec.StdIn.Close()
KeyWait, w
Exec.Terminate()
Return