Well, since when you create the window, you pass the size and position as a parameter (the rect), just save your rects in an array…
var arrWindows: Rect[] = new Rect[2];
arrWindows[0] = new Rect(100,100,100,100);
arrWindows[1] = new Rect(100,100,300,300);
windowRect[0] = GUI.Window (0, windowRect[0], DoMyWindow, "My Window");
windowRect[1] = GUI.Window (1, windowRect[1], DoMyWindow, "My Window");
var rectMax: Rect = GUILayoutUtility.GetRect (5000,5000);
Debug.Log(rectMax.width + "," + rectMax.height);
put this inside your “WindowFunction” function. This is important, since it will try to get the most space it can (you ask for 5000x5000 pixels), but since it will be insde the function that puts content inside the window, it will return a value smaller than 5000 - it would be constricted by the window area and will return the window width and height.
Untested in unity, but should work.