﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebDesktop - Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Sun, 04 Oct 2009 07:00:21 GMT</pubDate><dc:creator>james</dc:creator><description>&lt;p&gt;Al, try to add i-- after calling win.Close()&lt;/p&gt;&lt;p&gt;The code should look like:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;pre&gt;function CloseWindows()
{
	var dm = ISGetDesktopManager();
        var length = dm.Windows.length;
        for (var i=0; i&amp;lt;length; i&amp;#43;&amp;#43;)
        {            
        	var win = dm.Windows[i];
                if (win.ClientVisible == true)
                {
                    win.Close();&lt;br /&gt;                    i--;
                }
        }
}
&lt;/pre&gt;
&lt;p&gt;Let me know if it works for you. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;br /&gt;James.&lt;/p&gt;</description></item><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Sat, 03 Oct 2009 19:04:48 GMT</pubDate><dc:creator>alagarde</dc:creator><description>&lt;p&gt;Gordon;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;None of the windows close when I use your suggested code.  The problem appears to be line below:&lt;/p&gt;
&lt;p&gt;var win = dm.Windows[0];&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;When I cahnge this to:&lt;/p&gt;
&lt;p&gt;var win = dm.Windows[i];&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;It goes back to every other window closing.&lt;/p&gt;
&lt;p&gt;Do you have any other suggestions?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Al&lt;/p&gt;</description></item><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Mon, 28 Sep 2009 23:19:10 GMT</pubDate><dc:creator>gordont</dc:creator><description>&lt;p&gt;Hi Al,&lt;/p&gt;
&lt;p&gt;Try to use the following code:&lt;/p&gt;&lt;pre&gt;function CloseWindows()
{
	var dm = ISGetDesktopManager();
        var length = dm.Windows.length;
        for (var i=0; i&amp;lt;length; i&amp;#43;&amp;#43;)
        {            
        	var win = dm.Windows[0];
                if (win.ClientVisible == true)
                {
                    win.Close();
                }
        }
}&lt;/pre&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Gordon Tumewu&lt;/p&gt;</description></item><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Mon, 28 Sep 2009 12:12:35 GMT</pubDate><dc:creator>alagarde</dc:creator><description>&lt;p&gt;Glenn;&lt;/p&gt;
&lt;p&gt;I am stilling getting every other window to close.  The difference between my code and your is that am creating new windows with client side code rather than opening windows that alread exist.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Al&lt;/p&gt;</description></item><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Thu, 24 Sep 2009 02:38:05 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;I have tested the snippet on our environment, it is running as expected all the opened window will be closed. Attached is the sample we are using to test the snippet in our environment.&lt;/p&gt;&lt;p&gt;Have you used all the latest build of WebDesktop and WebUI Framework?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Thu, 24 Sep 2009 02:32:43 GMT</pubDate><dc:creator>gordont</dc:creator><description>&lt;p&gt;edited double post.&lt;/p&gt;</description></item><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Thu, 24 Sep 2009 00:34:30 GMT</pubDate><dc:creator>alagarde</dc:creator><description>&lt;p&gt;The code snippet appears twice, and I have been unable to remove the duplicate.&lt;/p&gt;</description></item><item><title>Close All Windows</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Close-All-Windows/</link><pubDate>Thu, 24 Sep 2009 00:18:25 GMT</pubDate><dc:creator>alagarde</dc:creator><description>&lt;span style="font-size: 13px; color: rgb(0, 0, 255);"&gt;&lt;span style="font-size: 13px; color: rgb(0, 0, 255);"&gt;&lt;p&gt;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?&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;pre&gt;function CloseWindows()&lt;br /&gt;{&lt;br /&gt;  var dm = ISGetDesktopManager();&lt;br /&gt;  for (var i = 0; i &amp;lt; dm.Windows.length; i&amp;#43;&amp;#43; )&lt;br /&gt;  {&lt;br /&gt;    var win = dm.Windows[i];&lt;br /&gt;    if (win.ClientVisible == true) { win.Close(); }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Edited 09/24/2009: encapsulate the code in &amp;lt;pre&amp;gt; tag to avoid duplication issue&lt;br /&gt;&lt;/p&gt;&lt;span style="font-size: 13px; color: rgb(0, 0, 255);"&gt;&lt;span style="font-size: 13px; color: rgb(0, 0, 255);" /&gt;&lt;/span&gt;</description></item></channel></rss>