is there any way to manage already opened window

the ultimate purpose is still bringing the latest opened window to front.if there is one way to store the already opened window,or generate window with window ID from 0,1 to 2,…dynamiclly ,then the problem maybe solved.

always keep in mind that windows work under the same constraints as the whole UI: at the end of the frame it ceases to exist. so commands you give this loop won’t take place anymore next frame

then is there anyway to deal with the existed windows?

You can choose to draw or not to draw a window each frame. It is only the GUI.Window call that makes it appear. If you do something like:-

if (showWindow) {
   GUI.Window(...);
}

…then the window will be drawn only on frames where showWindow is true.

if the window is created in different scripts,if there are too many window, then how to manage the already opened window?