pop ups in webbrowser control 
Author Message
 pop ups in webbrowser control

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



Sat, 21 Feb 2004 20:25:42 GMT  
 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



Tue, 02 Mar 2004 17:11:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How do I interfere with system pop-ups

2. Help pop-ups in MFC App

3. Command Processing in Pop-Ups

4. Dialog box pop-ups - SDI vs. MDI apps

5. Control webbrowser ActiveX control in composit ActiveX control

6. WebBrowser Control/Explorer Control/HTML Control

7. WebBrowser control - create my own user control

8. Controlling the WebBrowser control

9. How to control WebBrowser control (or MSHTML.DLL)

10. MFC like printer control with the Webbrowser control (CHtmlView)

11. MS WebBrowser control & right button pop-up menu

12. Pop-up list box over an edit control

 

 
Powered by phpBB® Forum Software