Bind SWindow OnWindowClosed

you can read it in this thread.