Internet Explorer Developer Center >
Internet Explorer Development Forums
>
Internet Explorer Extension Development
>
IShellWindows behaviour changed under Windows Vista?
IShellWindows behaviour changed under Windows Vista?
- 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
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);
}
}
}- 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 - 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 - 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 SP1Example from msdn http://msdn.microsoft.com/en-us/library/cc836570(VS.85).aspx
- Good to know you're running with UAC turned off.

- UAC is enabled
- does anyone find a way to solve this?

