Close All Windows

7 replies. Last post: October 4, 2009 7:00 AM by James
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

I am attempting to close all windows that are visible.  The following code closes every other window.  For example if there are 10 visible windows 5 will close.  What is the problem with the code?

function CloseWindows()
{
var dm = ISGetDesktopManager();
for (var i = 0; i < dm.Windows.length; i++ )
{
var win = dm.Windows[i];
if (win.ClientVisible == true) { win.Close(); }
}
}

Edited 09/24/2009: encapsulate the code in <pre> tag to avoid duplication issue

All times are GMT -5. The time now is 9:50 PM.
Previous Next