I've never seen a way to get the HWND for a browser (note there is more than one if one than one browser is open) from an XPCOM service or component. That doesn't mean there's no way to do it, but you can alwaysfind the HWND by using the WinAPI to enumerate all top-level windows looking for Firefox's window class.

----- Original Message ----
From: Frank
To: dev-extensions@lists.mozilla.org
Sent: Thursday, August 31, 2006 3:39:00 PM
Subject: HWND of Firefox browser on Windows

I am trying to port an Internet Explorer add-on to Firefox. I need to
get the windows handle (HWND) of the Firefox browser so that it can be
passed to an XPCOM component that will be used by my Firefox extension.

How can this be done?

It might be related to nsIEmbeddingSiteWindow and siteWindow. How do I
get the window using Javascript in a Firefox extension.


dev-extensions mailing list