nlegault
asked on
Make Web Browser stay on top of all applications.
Hi,
i'm trying to make a Web Browser (HTA) stay on top of all applications but not remove focus from users work on other apps. Just like the language bar. There is a web application (http://webtoolbars.com) that accomplishes this.
I'm looking for any suggestions / sample code.
Thanks,
Neil
on the window that needs to be on Top
<body onLoad="setTimeout(self.fo cus(), '0')">
<body onLoad="setTimeout(self.fo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Option 1: Make application come to front when first loaded
<body onload="self.focus();">
Option 2: Periodically come to front
<body onBlur="setTimeout('self.f ocus()',50 0)">
Option 3: Always up front (rather annoying)
<body onblur="self.focus();">
<body onload="self.focus();">
Option 2: Periodically come to front
<body onBlur="setTimeout('self.f
Option 3: Always up front (rather annoying)
<body onblur="self.focus();">
Actually, if you want it to allow access to other applications, but not your main window, you should use the IE-only showmodaldialog
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/showmodaldialog.asp
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/showmodaldialog.asp
The other option for other browsers is to store the window.opened child window in a variable, say myWin. In the parent window, have this:
<body onfocus="if (myWin&&!myWin.closed) {myWin.focus();}">
although this might fail if your myWin window refreshes or the parent window refreshes.
<body onfocus="if (myWin&&!myWin.closed) {myWin.focus();}">
although this might fail if your myWin window refreshes or the parent window refreshes.
ASKER
I am requesting that this request be closed and deleted. There have been no answers that satisfy the question.
Neil
Neil
what's wrong with my answer? it's the exactl same code as your webtoolbar that does "exactly" what you wanted.
ASKER
Your answer does not work as stated. Focus has been removed from the app. It is not "Exactly" what i wanted.
Neil
Neil
no it's not. Unless you're saying that when you -open- the HTA application, whatever you previously had selected loses focus. In which case, welcome to windows :-) Whenever you open -anything- the previously selected app loses focus because, well...you had to go click on something outside of that app to open your new app.
ASKER
My language bar doen not disapear behind something when i change focus..??
Neil
Neil
neither does this...at least not for me.
ASKER
Thanks cwolves, See combined solution and explanations for my 2 questions:
https://www.experts-exchange.com/questions/21117702/Can-i-create-an-object-outside-the-browser-window.html
Neil
https://www.experts-exchange.com/questions/21117702/Can-i-create-an-object-outside-the-browser-window.html
Neil
I believe it's possible in Netscape/Mozilla but maybe IE also. Use window.open with dependent set to yes, i.e.
window.open("http://www.google.com","GoogleWin"
Regards,
Zyloch