{"id":35043,"date":"2005-07-05T10:00:08","date_gmt":"2005-07-05T10:00:08","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/07\/05\/using-script-to-query-information-from-internet-explorer-windows\/"},"modified":"2005-07-05T10:00:08","modified_gmt":"2005-07-05T10:00:08","slug":"using-script-to-query-information-from-internet-explorer-windows","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050705-08\/?p=35043","title":{"rendered":"Using script to query information from Internet Explorer windows"},"content":{"rendered":"<p><P>\nSome time ago,\n<a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/07\/20\/188696.aspx\">\nwe used C++ to query information from the ShellWindows object\nand found it straightforward but cumbersome<\/A>.\n<\/P>\n<BLOCKQUOTE CLASS=\"q\">\nThis is rather clumsy from C++ because\n<A HREF=\"http:\/\/msdn.microsoft.com\/library\/en-us\/shellcc\/platform\/shell\/reference\/objects\/shellwindows\/shellwindows.asp\">\nthe <CODE>ShellWindows<\/CODE> object<\/A>\nwas designed for use by a scripting language like JScript or Visual Basic. \n<\/BLOCKQUOTE>\n<P>\nLet&#8217;s use one of the languages the ShellWindows object was designed for\nto enumerate all the open shell windows.\nRun it with the command line <CODE>cscript sample.js<\/CODE>.\n<\/P>\n<PRE>\nvar shellWindows = new ActiveXObject(&#8220;Shell.Application&#8221;).Windows();\nfor (var i = 0; i &lt; shellWindows.Count; i++) {\n  var w = shellWindows.Item(i);\n  WScript.StdOut.WriteLine(w.LocationName + &#8220;=&#8221; + w.LocationURL);\n}\n<\/PRE>\n<P>\nWell that was quite a bit shorter, wasn&#8217;t it!\n<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago, we used C++ to query information from the ShellWindows object and found it straightforward but cumbersome. This is rather clumsy from C++ because the ShellWindows object was designed for use by a scripting language like JScript or Visual Basic. Let&#8217;s use one of the languages the ShellWindows object was designed for to [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-35043","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Some time ago, we used C++ to query information from the ShellWindows object and found it straightforward but cumbersome. This is rather clumsy from C++ because the ShellWindows object was designed for use by a scripting language like JScript or Visual Basic. Let&#8217;s use one of the languages the ShellWindows object was designed for to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/35043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=35043"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/35043\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=35043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=35043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=35043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}