Click here to Skip to main content
15,881,803 members
Articles / Programming Languages / C#

Extended .NET 2.0 WebBrowser Control

Rate me:
Please Sign up or sign in to vote.
4.90/5 (118 votes)
29 Mar 20069 min read 1.4M   37.7K   341  
Extending the .NET 2.0 WebBrowser control.
using System;

namespace ExtendedWebBrowser2
{
  /// <summary>
  /// Flags used by INewWindowManager::EvaluateNewWindow. 
  /// These values are taken into account in the decision of whether to display a pop-up window.
  /// </summary>
  [Flags]
  enum UrlContext
  {
    /// <summary>
    /// No information Present
    /// </summary>
    None = 0x0,
    /// <summary>
    /// The page is unloading. This flag is set in response to the onbeforeunload and onunload events. 
    /// Some pages load pop-up windows when you leave them rather than when you enter. This flag is used to identify those situations.
    /// </summary>
    Unloading = 0x1,
    /// <summary>
    /// The call to INewWindowManager::EvaluateNewWindow is the result of a user-initiated action 
    /// (a mouse click or key press). Use this flag in conjunction with the NWMF_FIRST_USERINITED flag 
    /// to determine whether the call is a direct or indirect result of the user-initiated action.
    /// </summary>
    UserInited = 0x2,
    /// <summary>
    /// When NWMF_USERINITED is present, this flag indicates that the call to 
    /// INewWindowManager::EvaluateNewWindow is the first query that results from this user-initiated action. 
    /// Always use this flag in conjunction with NWMF_USERINITED.
    /// </summary>
    UserFirstInited = 0x4,
    /// <summary>
    /// The override key (ALT) was pressed. The override key is used to bypass the pop-up manager�allowing 
    /// all pop-up windows to display�and must be held down at the time that INewWindowManager::EvaluateNewWindow is called. 
    /// </summary>
    OverrideKey = 0x8,
    /// <summary>
    /// The new window attempting to load is the result of a call to the showHelp method. Help is sometimes displayed in a separate window, 
    /// and this flag is valuable in those cases.
    /// </summary>
    ShowHelp = 0x10,
    /// <summary>
    /// The new window is a dialog box that displays HTML content.
    /// </summary>
    HtmlDialog = 0x20,
    /// <summary>
    /// Indicates that the EvaluateNewWindow method is being called through a marshalled Component Object Model (COM) proxy 
    /// from another thread. In this situation, the method should make a decision and return immediately without performing 
    /// blocking operations such as showing modal user interface (UI). Lengthy operations will cause the calling thread to 
    /// appear unresponsive.
    /// </summary>
    FromProxy = 0x40
  }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Chile Chile
I am
- born in The Netherlands
- living in Chile together with my wife.
- a Microsoft Certified Professional Developer on all 3 areas (Windows, Web and Enterprise)
- an MCITP on Microsoft SQL Server 2005 (Database Administrator)
- an active programmer for about 14 years.
- a business owner, of a Dutch company called "The Wheel Automatisering" (http://www.thewheel.nl)
- a coder in C#, VB.Net and Managed C++.
- someone who likes to share knowledge

For fun I like to go out with my dogs, enjoy the sun or write some articles that I share with the community.

Comments and Discussions