?
Solved

Make Web Browser stay on top of all applications.

Posted on 2004-09-02
14
Medium Priority
?
1,533 Views
Last Modified: 2008-06-18

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
0
Comment
Question by:nlegault
  • 4
  • 4
  • 3
  • +2
13 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 11970366
Hi

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","width=500,height=300,dependent=yes");

Regards,
Zyloch
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 11970400
on the window that needs to be on Top

<body onLoad="setTimeout(self.focus(), '0')">
0
 
LVL 9

Accepted Solution

by:
cwolves earned 450 total points
ID: 11970556
<SCRIPT LANGUAGE="JavaScript">
var oPopup = window.createPopup();
function o()
{
     HEIGHT = 25;
     WIDTH  = screen.availWidth;
     TOP    = -2000;
     LEFT   = -2000;

     var oPopBody                   = oPopup.document.body;
     oPopBody.style.backgroundColor = "lightyellow";
     oPopBody.style.borderBottom    = "solid black 1px";
     oPopBody.innerHTML             = "Demo";
     oPopup.show(LEFT, TOP, WIDTH, HEIGHT, document.body);
}
function c(){
      if(!oPopup.isOpen) o();
}
document.onclick = o;
setInterval('c();', 100);
o();
</SCRIPT>

Move the hta off screen (self.moveTo(5000,5000);) and put all your stuff in this.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 2

Expert Comment

by:cheyennejk
ID: 11977012
Option 1: Make application come to front when first loaded
<body onload="self.focus();">


Option 2: Periodically come to front

<body onBlur="setTimeout('self.focus()',500)">

Option 3: Always up front  (rather annoying)

<body onblur="self.focus();">
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 11977064
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
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 11977074
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.
0
 

Author Comment

by:nlegault
ID: 12307325
I am requesting that this request be closed and deleted. There have been no answers that satisfy the question.

Neil
0
 
LVL 9

Expert Comment

by:cwolves
ID: 12307905
what's wrong with my answer?  it's the exactl same code as your webtoolbar that does "exactly" what you wanted.
0
 

Author Comment

by:nlegault
ID: 12308105
Your answer does not work as stated. Focus has been removed from the app. It is not "Exactly"  what i wanted.

Neil
0
 
LVL 9

Expert Comment

by:cwolves
ID: 12308176
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.
0
 

Author Comment

by:nlegault
ID: 12308287
My language bar doen not disapear behind something when i change focus..??

Neil
0
 
LVL 9

Expert Comment

by:cwolves
ID: 12308364
neither does this...at least not for me.
0
 

Author Comment

by:nlegault
ID: 12308589
Thanks cwolves, See combined solution and explanations for my 2 questions:
 http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21117702.html


Neil
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question