
pop ups in webbrowser control
Hallo Abhimanyu,
this problem is a little bit tricky.
I had the same effect in my application.
I assume, that you have a MFC-based SDI app.
using a class derived from CHTMLView.
You have overridden OnNewWindow2 to create
a new instance of your FrameWnd.
The effect is, that popupwindows (as a result of
window.open) have the wrong size, the toolbar is
visible and so on ...
You must set 2 variables (global, not members of your view)
in OnNewWindow2 like this:
bResizeWindow=TRUE;
m_pFramwWnd = .. (your newly created frame).
Initialize them to FALSE and NULL in your
View constructor.
In OnBeforeNavigate2 of your CHTMView derived class,
you check
...
if (bResizeWindow)
{
Get an Pointer to IWebBrower2 Interface of
your webbrowser by querying your
IDispatch that you retrive by GetApplication().
Look at the methods of IWebBrower2, you'll find
get_Width, get_Height, get_AdressBar ..., that defines
all the attributes of the newly created window.
Call SetScrollSizes of the active View of m_pFrameWnd.
Call ResizeParent of m_pFrameWnd and assign
the attributes to m_pFrameWnd. (like resizable ...)
bResizeWindow = FALSE;
m_pNewFrame = NULL;
Quote:
}
}
I hope this helps.
Yours sincerely
Sigi B?der
Quote:
> hi all,
> I am having a SDI (Chtmlview) app, which is supposed to be a custom browser.
> I am able to handle new windows from a web page's context menu
> but not able to get a notification about popups.(as they have to b treated
> differently)
> Any idea about this!!!
> Thanks,
> Abhimanyu