The thing is that the handler system windows use does not expect you to update anything for a couple of frames like you want to do it there. It simply closes or hides the window and that's it. At the end you'd need to overwrite a couple of inherited methods to make it happen.