I got a requirement about the pop-up block staff. It is said in MSDN that
developer can implement INewWindowManager interface to handle the case under
your own rules(you can override some or all of the Microsoft Internet
Explorer pop-up blocking logic).
After installing the XP SP2 SDK, I found the definition of
INewWindowManager in shobjidl.h (which is said to be "shlobj.h" in
documentation), but I could not found the guid of it in registry or by OLE
Viewer.
I have made some sample codes, how the implemented EvaluateNewWindow
method is not called when new window is popped up(also IDocHostUIHandler is
implemented in the same class). Can anyone help me out?
Your reply will be great appreciated, :).
My codes are enclosed below.
[ComVisible(false), ComImportAttribute()]
[GuidAttribute("D2BC4C84-3F72-4a52-A604-7BCBF3982CBB")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface INewWindowManager
{
[PreserveSig()]
void EvaluateNewWindow(String strUrl, String strName, String
strUrlContext, String strFeatures, bool fReplace, Int32 nFlags);
}
> I have made some sample codes, how the implemented EvaluateNewWindow
>method is not called when new window is popped up(also IDocHostUIHandler is
>implemented in the same class). Can anyone help me out?
The way I understand it, it's the host of the webbrowser control that
should implement the interface. In the WinForms world that's the
AxHost control, which you obviously can't add additional interface
implementations to. That might be a problem.
> [PreserveSig()]
> void EvaluateNewWindow(String strUrl, String strName, String
>strUrlContext, String strFeatures, bool fReplace, Int32 nFlags);
> }
The return type should be (u)int, not void. All the string parameters
should be marked with [MarshalAs(UnmanagedType.LPWStr)] and the bool
with UnmangedType.Bool.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Will Janus - 13 Sep 2005 12:34 GMT
Thank you very much for correcting my faults in codes.
I've found some complains on internet talking about the interface, and no
one seems to have got the door open, it looks like a joke from MSDN, :(.

Signature
happy coding.
> > I have made some sample codes, how the implemented EvaluateNewWindow
> >method is not called when new window is popped up(also IDocHostUIHandler is
[quoted text clipped - 15 lines]
>
> Mattias