Forum Discussion
spatel_1
13 years agoOccasional Contributor
Hi Ofer,
Here's how I would do it:
var window = myWindow;
if(window["IsMaximized"]) //If the window is maximized
window["Restore"](); //Unmaximize it
window["Position"](500, 500, 500, 500); // Set the window's position.
It's possible however that your window won't have the IsMaximized property. If this is the case, then I would use the Top and Left properties to determine if it's maximized. These properties are both equal to -8 when the window is maximized (at least they are for me).
var window = myWindow;
if(window["Top"] == -8 && window["Left"] == -8) //If the window is maximized
window["Restore"](); //Unmaximize it
window["Position"](500, 500, 500, 500); // Set the window's position.
Here's how I would do it:
var window = myWindow;
if(window["IsMaximized"]) //If the window is maximized
window["Restore"](); //Unmaximize it
window["Position"](500, 500, 500, 500); // Set the window's position.
It's possible however that your window won't have the IsMaximized property. If this is the case, then I would use the Top and Left properties to determine if it's maximized. These properties are both equal to -8 when the window is maximized (at least they are for me).
var window = myWindow;
if(window["Top"] == -8 && window["Left"] == -8) //If the window is maximized
window["Restore"](); //Unmaximize it
window["Position"](500, 500, 500, 500); // Set the window's position.