init the window status