You should try changing it to the second one in the example above as its a cleaner way to kill the emulator.
$Esc::
{
WinClose, ahk_exe demul.exe
}
@JoeViking245or @jayjaywhat would he need to do to change his script to use the escape key but have it send Alt+F4 instead? (sorry to bother your guys but you are the communities AHK gurus)