Babele Dunnit wrote:
On Jan 19, 4:09 pm, Timothy Madden <[email protected]> wrote:
Hello
I embedded the browser in my application and I would like to get a
pointer to the DocShell after loading a URL. How could I do that ?
nsIDocShell appears to be documented, or at least it was when it was
called WebShell, but still I get no links to how to get to the interface ..
Thank you,
Timothy Madden
HI Tim,
nsCOMPtr< nsIDocShell > docShell = do_GetInterface( mWebBrowser );
XPCOM/Gecko/FF/Mozilla code relies heavily on interface navigation
(like any other COM-like framework, I suppose). How and when an object
supports multiple interfaces is forbidden Jedi knowledge IMHO. I never
have found anything explaining clearly and deeply who does what, also
because there are some millions lines of code out there. Use MXR and
search for snippets of code.
Ciao,
Aaron
PS: I am in the middle of understanding how scrolling works. Just try
to search "scroll" in MXR and get what I mean. :)
Wow !
Thank you Aaron !
I was sure no one cares to answer any more !
I found out by trying the same thing. Of course I have also noticed the
code is hardly documented. And docShell is considered an internal component.
What I want is a list of child window controls (HWNDs on Windows) that
collaborate to display an HTML page. I want to subclass them and have
some rectangular area on the page appear 'selected'.
I found out that for this list of windows I do not need a docShell, and
that I can get a rendering context for each and every content frame (not
HTML frames) in the document content and get the HDC from there, which
will give me the HWND.
The problem is this is way to slow; I also need to restart the content
traversal looking for HDCs after any change in the document triggered by
mouse-ing over it or by timed scripts or other scripting triggers.
Do you know a better way to get the list of HWNDs that collaborate to
display an HTML page ?
Thank you,
Timothy Madden
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding