Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2005

Tip: Looking for answers? Try searching our database.

how can I import the INewWindowManager interface?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SpotlessWill - 09 Sep 2005 12:30 GMT
   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);
    }
Mattias Sjögren - 09 Sep 2005 19:29 GMT
>    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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.