Re: Firefox 3.6 : How can I obtain a HWND from the correspondingnsIDOMDocument object?
"Oliveiros C," <[email protected]>
| Newsgroups | gmane.comp.mozilla.accessibility |
|---|---|
| Message-ID | <[email protected]> |
Hello, David. Thanks a lot for your help and suggestion. It worked without any problems at first time! Take care Best, Oliveiros ----- Original Message ----- From: "David Bolter" <[email protected]> To: <[email protected]> Sent: Wednesday, February 24, 2010 4:49 PM Subject: Re: Firefox 3.6 : How can I obtain a HWND from the correspondingnsIDOMDocument object? > 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 >> > > _______________________________________________ > dev-accessibility mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-accessibility