Alt f4 is a very easy going shortcut key and widely in use. But, sometimes the simple things don't give simple results. It can hang, refuse to end, or even crash your file. So, in this case, you need to disable the functionality of this shortcut from the control panel.