![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Opening an hidden Window with window.open (HTML) Hi, I'm trying to open a new hidden window from an HTML page. I know that this is possible using the InternetExplorer.Application object, but for other reasons I need to use the open method of the current window. In this way I've a reference to the creating window from the created window (window.opener). The problem is that I cannot find a way to hide the created window. Is there any way to achieve this ? Alternatively, is there any way to get the InternetExplorer.Application object associated with a window ? I tryed window.parent, but seems to return the window itself. Thanks. Massimo. -- |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Opening an hidden Window with window.open (HTML) MassimoP wrote: Quote: > I'm trying to open a new hidden window from an HTML page. > I know that this is possible using the InternetExplorer.Application > object, but for other reasons I need to use the open method > of the current window. In this way I've a reference to the > creating window from the created window (window.opener). > The problem is that I cannot find a way to hide the created > window. Is there any way to achieve this ? > Alternatively, is there any way to get the InternetExplorer.Application > object associated with a window ? I tryed window.parent, but > seems to return the window itself. > You might try using the "Shell.Applicaton" object, which will provide you with a collection of windows. The windows you get are InternetExplorer windows _plus_ windows-explorer windows. The way you tell them apart is via the type of the window. document property, where "HTMLDocument" implies an IE window, and "IShellFolderViewDual" implies a windows-explorer window. There is an hta attached, which provides an example of this. The properties of the window objects are "hidden" (at least to me), and so I can't take you further. But you can probably use the doc object of the IE windows to get the window's title (caption), and maybe work with that (plus some other scripting magic) to hide the window. cheers, jw ____________________________________________________________ You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions) p.s., if you are not adverse to calling the system api's from script, then you could use the hWnd and the ShowWindow api with the SW_HIDE parameter to hide the window. <HEAD> <HTA:APPLICATION> </HEAD> <HTML> <BODY> <SCRIPT LANGUAGE="VBScript"> ' enum shell windows (most likely IE and Explorer windows). jw 11June08 ' report the hWnd of IE windows present... set shell = CreateObject("shell.application") for each oWin in shell.windows ' walk through the shell window collection ' determine whether window is IE or just explorer... sWinType = TypeName(oWin.Document) Select Case sWinType Case "HTMLDocument" document.write "<pre>" document.write _ "Window Document Type: " & TypeName(oWin.Document) & "<br>" & _ "LocationURL: " & oWin.locationURL & "<br>" & _ " (note: this window appears to be an instance of InternetExplorer... <br>" & _ "Window hWnd: " & CStr(oWin.hWnd) & "<br>" document.write "</pre>" Case "IShellFolderViewDual" document.write "<pre>" document.write _ "Window Document Type: " & TypeName(oWin.Document) & "<br>" & _ "LocationURL: " & oWin.locationURL & "<br>" & _ " (note: this window appears to be an instance of windows explorer... <br>" & _ "Window hWnd: " & CStr(oWin.hWnd) & "<br>" document.write "</pre>" Case Else document.write "<pre>" document.write _ "Window Document Type: " & TypeName(oWin.Document) & "<br>" & _ "LocationURL: " & oWin.locationURL & "<br>" & _ " (note: this window is not a recognized type... <br>" & _ "Window hWnd: " & CStr(oWin.hWnd) & "<br>" document.write "</pre>" End Select next </SCRIPT> </BODY> </HTML> |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Opening an hidden Window with window.open (HTML) mr_unreliable wrote: Quote: > MassimoP wrote: Quote: > > I'm trying to open a new hidden window from an HTML page. > > I know that this is possible using the InternetExplorer.Application > > object, but for other reasons I need to use the open method > > of the current window. In this way I've a reference to the > > creating window from the created window (window.opener). > > The problem is that I cannot find a way to hide the created > > window. Is there any way to achieve this ? > > Alternatively, is there any way to get the > > InternetExplorer.Application object associated with a window ? I > > tryed window.parent, but seems to return the window itself. > > > hi Massimo, > > You might try using the "Shell.Applicaton" object, which will > provide you with a collection of windows. The windows you get > are InternetExplorer windows plus windows-explorer windows. > > The way you tell them apart is via the type of the window. > document property, where "HTMLDocument" implies an IE window, > and "IShellFolderViewDual" implies a windows-explorer window. > > There is an hta attached, which provides an example of this. > > The properties of the window objects are "hidden" (at least > to me), and so I can't take you further. But you can probably > use the doc object of the IE windows to get the window's title > (caption), and maybe work with that (plus some other scripting > magic) to hide the window. > > cheers, jw > ____________________________________________________________ > > You got questions? WE GOT ANSWERS!!! ..(but, no guarantee > the answers will be applicable to the questions) > > p.s., if you are not adverse to calling the system api's > from script, then you could use the hWnd and the ShowWindow > api with the SW_HIDE parameter to hide the window. in this way I find the window object, but I already have it in return from window.open call. The problem is that the window object doesn't have a visible property. Only the InternetExplorer.Application object has a visible property. Moreover, even in case I can find some magic to hide the window, in this phase is late, cause the window.open lasts for about half a second waiting IE to load the page (even about:blank), so, hiding after the window.open, means having a flicker on the screen. I realized that may be better not to hide the window, but open a page with something like "Please Wait...", that doesn't scare the user. Thanks anyway for you reply. Massimo. -- |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Opening an hidden Window with window.open (HTML) Maybe it would help if you explain what you're trying to accomplish. You created 1 IE but you can't use 2? You need to open a new window, but you don't want it to show? |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Opening an hidden Window with window.open (HTML) mayayana wrote: Quote: > You need to open a new window, > but you don't want it to show? > to show stuff. If one wants a "hidden window", then any hidden window will do. wsh+vbs has three hidden windows, the last time I counted. Maybe one of those would do. One other minor point. You don't have to have a "visible" property to hide a window. All you need is to move it "offscreen", by setting the windows left and/or top property to some large negative (or positive for that matter) value. While offscreen, it may remain visible, but nobody can see it. "Back-in-the-old-days", one could use the "MoveTo" method to move the IE window offscreen, but ms has put a stop to that foolishness. After all, who could ever want to move a window offscreen. (It can still be done via the system api, though). cheers, jw |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Windows Mail progress window details won't stay hidden | Vista mail | |||
| Error message when clicking on links and extra pop up html window. | Vista mail | |||
| How to show the hidden folder again in Window Mail | Vista mail | |||
| New window opening | Vista General | |||
| loading an html string into an IE window | PowerShell | |||