how to pass session context and cookie in newwindows3 event of fomrs.webbrowser

G

GS

I am referring to the windows forms variety of webbrowser not the
axwebbrowser

I tried different approaches but failed to have anything show up in the
designated new webbrowser. Instead I get a new instance of IE. I think
missed something critical

here are my attempts
Sub Svd_NewWindow3(ByRef ppDisp As Object, ByRef Cancel As Boolean, ByVal
dwFlags As UInteger, ByVal bstrUrlContext As String, ByVal bstrUrl As
String)
Dim idxNewTabpage As Integer = 0
Dim webBrowserNew As System.Windows.Forms.WebBrowser =
createWebBrowserNTabPage(idxNewTabpage)

' any of of the following will stop execution of the sub and pops up
the new instance of IE - no error messages
'Dim myCookie As Integer = Me.WebBrowser1.Document.Cookie
'webBrowserNew.Document.Cookie = myCookie
'webBrowserNew.Document.Cookie = Me.WebBrowser1.Document.Cookie

' does not work still pops up a new window:
Dim svdNew As SHDocVw.WebBrowser =
DirectCast(webBrowserNew.ActiveXInstance, SHDocVw.WebBrowser)
svdNew.RegisterAsBrowser = True
ppDisp = webBrowserNew
Cancel = False

' also tried without luck:
'svdNew.Navigate2(bstrUrl, dwFlags, o, o,
WebBrowser1.Document.Cookie) 'o) 'targetframe, PostData:=, Headers)
'svdNew.Navigate2(ppDisp, dwFlags, o, PostData, Headers)
'Cancel = True

end sub

in all cases I either get 440 invalid httprequest in the webbrowserNew or
nothing in there
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top