Firefox 3.6 : How can I obtain a HWND from the corresponding nsIDOMDocument object?
"Oliveiros C," <[email protected]>
| Newsgroups | gmane.comp.mozilla.accessibility |
|---|---|
| Message-ID | <[email protected]> |
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