remember window state even if script reload

hi
i modify the script , so it can remember window_state when script reload.
i again show myself :-0