Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how do you get document hwnd?

18 views
Skip to first unread message

sabin...@gmail.com

unread,
Nov 29, 2006, 6:55:31 PM11/29/06
to
Sorry this is a repost from mozilla.dev.xpcom.

I was just wondering if there is a way to get the HWND of the main
document in firefox/mozilla? I've been scouring the internet for this
answer, and the methods that people have suggested is using
nsIAccessibleDocument's windowHandle attribute (which I don't like
since it is tied to an unfrozen interface that can't be used in
javascript) and nsIBaseWindow's parentNativeWindow (which is also an
unfrozen interface but can be accessed via javascript, but
unfortunately it doesn't seem to work).

I don't like the idea of using nsIAccessibleDocument because I have to
compile in the header file and my xpcom component will be tied to one
version of firefox and if the interface changes later on, it can cause
horrible problems.

The main reason I need the HWND is to be able to detect "onmouseover"
and "onmouseout" events for object/embed tags. I want to be able to
determine that I moused over some object like the windows media plugin
or flash plugin. Just using the javascript event handler works
horribly in firefox (only when I mouse a small 1 pixel tall area on the
bottom of the embedded plugin I'm able to receive events every now and
then, but mouse events works perfectly fine in IE).

Better than getting the HWND, if you know of a way to consistently get
mouse events for the whole area of the object/embed tags in firefox,
that would be great.

---Paul Cho

Neil

unread,
Nov 30, 2006, 8:56:46 AM11/30/06
to
sabin...@gmail.com wrote:

>Better than getting the HWND, if you know of a way to consistently get mouse events for the whole area of the object/embed tags in firefox, that would be great.
>
>

For flash I think there may be an attribute wmode="transparent" or some
such that might work.

--
Warning: May contain traces of nuts.

sabin...@gmail.com

unread,
Nov 30, 2006, 3:48:51 PM11/30/06
to
> For flash I think there may be an attribute wmode="transparent" or some
> such that might work.

Thanks for the reply.

I just tried it out and it does work for flash, but it doesn't seem to
work for windows media plugin (windowlessvideo="true"). I'm also not
sure if it will work with quicktime or realplayer.

In the end I may have to resort to wmode="transparent", but I was
wondering if there was a more general solution. Also changing the mode
of a plugin seems kind of intrusive for an extension to just detect
mouseover/mouseout events.

---Paul Cho

0 new messages