On Aug 28, 8:15 am, ra <[email protected]> wrote: > Hi Matthew, > > here is a code snippet that worked for me. At least for an embedded > gecko 1.8.1. > > nsCOMPtr<nsIDOMEventTarget> cpEventTarget; > nsCOMPtr<nsIDOMWindow> cpDomWin; > m_pWebBrowser->GetContentDOMWindow (getter_AddRefs(cpDomWin)); > nsCOMPtr<nsIDOMWindow2> cpDomWin2 (do_QueryInterface (cpDomWin)); > cpDomWin2->GetWindowRoot(getter_AddRefs(cpEventTarget)); > > rv = cpEventTarget->AddEventListener(NS_LITERAL_STRING("mousedown"), > m_pBrowserImpl, PR_FALSE); > > I did this after initialization and m_pBrowserImpl received the > mousedown events. > > regards, > Rainer
Thank you, that works. I had tried before to get a nsIDOMWindow2, and then GetWindowRoot, but I guess I still don't know when to use stuff like QueryInterface and AddRefs. Thanks again, Matthew _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
