Re: Firefox 3.6 : How can I obtain a HWND from the corresponding nsIDOMDocument object?

David Bolter <[email protected]>
Newsgroups gmane.comp.mozilla.accessibility
Message-ID <[email protected]>
Hi Oliveiros,

This probably happened as part of the work on 
https://bugzilla.mozilla.org/show_bug.cgi?id=352093.

Perhaps you could use  nsIView::GetNearestWidget?

cheers,
David
On 24/02/10 7:25 AM, Oliveiros C, wrote:
> Dear List,
>
> I have this code , in which spiDocument is an nsIDOMDocument.
>
>
>
>
> nsresult lReturnVal;
>
> HWND hWnd=NULL,hParentWindow;
>
> nsCOMPtr<nsIDocument>  spiDoc = do_QueryInterface(spiDocument);
>
> nsIPresShell *piShell = spiDoc ->  GetPrimaryShell();
>
> if (piShell)
>
> {
>
> // Find hWnd
>
> nsIViewManager* piViewManager = piShell ->  GetViewManager();
>
> if (piViewManager)
>
> {
>
> nsCOMPtr<nsIWidget>  spiWidget;
>
> piViewManager ->  GetWidget(getter_AddRefs(spiWidget));
>
> if (spiWidget)
>
> hWnd = static_cast<HWND>  (spiWidget ->  GetNativeData(NS_NATIVE_WINDOW));
>
> }//if
>
> }//if
>
> hParentWindow = GetAncestor(hWnd,GA_ROOT);
>
> return hWnd;
>
>
>
> This used to work on previous versions of xulrunner, but on the newest xulrunner 1.9.2 it doesnt work, because the GetWidget() method is no longer supported by the nsIViewManager interface.
>
>
>
> Can anyone please kindly point me the correct way to handle this (new) situation?
>
>
>
> Thanx in advance,
>
>
>
> Best,
>
> Oliveiros d'Azevedo Cristina
> _______________________________________________
> dev-accessibility mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-accessibility
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.