Implemented the WINDOW_CREATE and WINDOW_DESTROY events.