Adding the patch of David Dufberg Töttrup to implement WM_DELETE_WINDOW. Thank you!