Chris Shen wrote:

> Hi All,
>
> I have an application (based on winembed example) embedding a web browser.
> My application forges a key event and I tried to use PostMessage to web
> browser. As I found, I have to post the message to the nsWindow instance
> which is created through the windowchrome and registered independently.
> Unfornately, the nsWindow's GetWindowHandle is not an interface method. So,
> I have to make the method into the nsIWidget/nsIWindow interface and rebuild
> the whole library or use brutal casting to nsWindow to get access the
> method. I'm not keen to use these solutions at the moment. Is any clear way
> to pass the faked key event to the focused nsWindow? Is any alternative?
> Does the mozilla provide individual module build because I have to build all
> if I change/create some thing like nsIWindow?
>
> Thanks for all replies
>
> JB

The web browser object implements nsIBaseWindow. Call
nsIBaseWindow::GetMainWidget to obtain the browser's widget. Call
nsIWidget::GetNativeData(NS_NATIVE_WINDOW) to get the HWND.

Adam


Reply via email to