none
IShellWindows behaviour changed under Windows Vista?

    Question

  • Hi

    After a bit of experimenting, it seems to me like IShellWindows only enumerates "true" Shell Windows under Vista. Internet Explorer Windows are ignored, unlike in  previous Windows versions. Is there another way to enumerate all open Internet Explorer windows in Vista and accessing their IWebBrowser interface?

    Thanks in advance,
    Robert
    Wednesday, January 31, 2007 12:32 PM

All replies

  • I am not aware of any difference. I ran this sample jscript which enumerates the windows and it was able to retrieve information regarding IE windows too. This code is modified from the sample on MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/shellwindows/shellwindows.asp)

    var objShell = new ActiveXObject("Shell.Application");
    var objShellWindows;
           
    objShellWindows = objShell.Windows();
    if (objShellWindows != null)
    {
         var objIE;
         for (var i = 0; i < objShellWindows.Count; i++)
         {
               objIE = objShellWindows.Item(i);
                if (objIE)
                {
                     WScript.Echo(objIE.LocationURL);
                }
         }
    }

    Friday, February 02, 2007 1:19 AM
  • Hi,

    Thanks for the answer. I have copied the example to a .js file (with one modification: inserting "WScript.Echo(objShellWindows.Count);" before "var objIE;") and ran it under Windows Vista, but it displays "0" regardless of how many IE windows I open. Only "true" Shell windows are counted. Maybe it has something to do with the version of Windows Vista I am running or with some (security) settings? I am using the German release version of Windows Vista Ultimate - downloaded from MSDN.

    Best Regards,
    Robert
    Monday, February 05, 2007 9:52 AM
  • Hi again,

    I am (hopefully) one step closer to solving the problem. It seems that IShellWindows works as usual if User Account Control is disabled, but when UAC is enabled, it "hides" the IE windows - see also http://www.teknologika.com/blog/WatiNAndVistaRC1.aspx. So this is probably a new security feature, as I suspected. Of course, the MSDN documentation hasn't been updated yet ... So I suspect I'll have to look into "elevating" the program's rights in order to get it working again. But if someone here has other suggestions, they're still very welcome...

    Greetings,
    Robert
    Monday, February 05, 2007 4:14 PM
  • Sorry for diggin this grave, but due to this http://www.google.com/search?hl=en&q=IShellWindows+MSDN&btnG=Search
    (3rd place in search now, yea this thread indexed fine) i can say - all works fine with my Vista SP1


    Thursday, November 13, 2008 10:05 PM
  • Good to know you're running with UAC turned off. Smile
    Friday, November 14, 2008 5:27 PM
  • UAC is enabled 
    Monday, November 17, 2008 1:34 PM
  • does anyone find a way to solve this?
    Monday, December 28, 2009 11:57 AM