[Project_owners] How to focus <dialog/> ?

Eric H. Jung grimholtz at yahoo.com
Sat Jan 28 08:09:20 EST 2006


Hi,

I asked this question here
http://forums.mozillazine.org/viewtopic.php?t=373278 but that didn't
help...

I'm using this code to focus/activate/bring-to-top both <window/> and
<dialog/> elements:

Components.classes["@mozilla.org/appshell/window-mediator;1"]
  .getService(Components.interfaces.nsIWindowMediator)
  .getMostRecentWindow("passwordmaker")
  .focus();

It works if getMostRecentWindow() returns a <window/>, but if it
returns a modal <dialog/>, I get this exception:

"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIDOMWindowInternal.focus]"  nsresult: "0x80004005

I'm using windowtype="passwordmaker" as a dialog attribute. Anyone know
what I'm doing wrong?

Thank you,
Eric Jung

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Project_owners mailing list