Getting Window by WindowId

How can i get the window by it’s id in code:

void WindowFunction (int windowID) {
		if (GUI.Button( new Rect( window.width/2, window.height/2, 140, 70), "Play")){
			_isLoading = true;
			Debug.Log("js_mainmenu: Play");
		}

How must i declare and setting up the “window”?

Check the documentation. There’s a code example there that demonstrates how to do this.

The first parameter in the function is the ID of the window…
So later you can do:
GUI.BringWindowToFront(nMyWindowID);

Hm. This is undertand, But I need to get the size of window by his ID. =(

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");

then just use:

Debug.Log(arrWindows[myWindowId].width + "," + arrWindows[myWindowId].height);

If you want a dirty trick, you can try:

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.