How To: Close the Form hosting the WebBrowser control when scripting calls window.close in the .Net Framework version 2.0

By design the WebBrowser Control does not close the parent Form when WebBrowser Control is closed.  Here is one way you can accomplish this. The WebBrowser will send a WM_NOTIFYPARENT notification that can be captured and an event raised that a host can respond to. Here is the documentation on the WM_NOTIFYPARENT notification:  http://msdn2.microsoft.com/en-us/library/ms632638.aspx In…

3

How To: Capture the NewWindow2 Event from a Managed WebBrowser Control

The articles referenced in my post Internet Explorer WebBrowser Control loses state… discusses sinking this event by adding an unmanaged version of the WebBrowser control to your Form and using that.  But what if you want to use the Managed version?  The manged version of the WebBrowser control is really a wrapper around the unmanaged…

2

Extra Characters (/r/n) when Converting MFC ISAPI under VS 2005

When you convert an MFC ISAPI project you created in an early version of Visual Studio to MFC 8 (VS 2005) you may notice that there is an extra set of carriage return linefeed characters.  This will be true if your code does not add a header to the return stream.  You can see this if…


Internet Explorer WebBrowser Control loses state when JScript performs a call to Window.Open

Session state for a web site is often stored in cookies.  If you use the WebBrowser control in an program and the target website responds to an action with a call to Window.Open, then mysteriously the cookies for that site are not transmitted with the request. Cause:  Window.Open creates a window using the IExplore.exe process…


The ServicePointManager does not support proxies of https scheme (.NET 1.1 SP1)

This was an interesting error that I had to hunt down.  When specifying a proxy server in .NET like this: WebProxy(“https://someproxyserver”) you will get this error.  You will get this error for whatever scheme that you enter before the “://” characters.  For example if you use this: WebProxy(“somescheme://someproxyserver”) Then you will get the error message:…

15

Internet Explorer Cache filenames are not configurable

So What?  You may ask.  This sometimes may be confusing to users!  When you click on a file link in Internet Explorer you are presented with a dialog that has a Save and Open button.  When you choose Save, the filename is under your control and the Save File Dialog will get the file name from the…