Opening a link in a new window

Hi!
Im having this problem, im trying to make a custom IE webbrowser and i have ran into a problem, i cant right-click and select 'open link in new window', it opens a new window using:

Private Sub wb_NewWindow2(ppDisp As Object, Cancel As Boolean)
On Error Resume Next

Dim winn As Subbb
Set winn = New Subbb
winn.Visible = True
Cancel = True
End Sub

but i cant figure out how to make the new window go to the selected link.

also, when the webpage automaticly wants to open a new window (by following a link that opens a new window) it opens iexplore, and i dont want that.

I have tryed to overwrite iexplore.exe with my own exe file, and then uses the command$ to go to the website, however, all i get from the command$ is a "-Embedded", so it seems as that wont work.

How can i open a link in a new window and how can i follow a link that opens a new window?

Any help about this would be grately appreciate!

Thank you!

/Christian

Comments

  • using [blue]Cancel = True[/blue] completely cancels the navigate action. instead you want to redirect the navigate action to the browser in the new window. to do so, set ppDisp to the webbrowser object that you want to navigate to the new url, and don't cancel the action. when the [b]wb_NewWindow2[/b] process ends, it'll first check to see if [italic]ppDisp[/italic] is a reference to an object, and if so it'll tell that object to navigate to the new url; if not it'll tell the current webbrowser to navigate to the new url. here's the fixed code:

    [code]
    Private Sub wb_NewWindow2(ppDisp As Object, Cancel As Boolean)
    On Error Resume Next

    Dim winn As Subbb
    Set winn = New Subbb
    winn.Visible = True
    Set ppDisp = winn.wb.Object
    End Sub
    [/code]




    : Hi!
    : Im having this problem, im trying to make a custom IE webbrowser and i have ran into a problem, i cant right-click and select 'open link in new window', it opens a new window using:
    :
    : Private Sub wb_NewWindow2(ppDisp As Object, Cancel As Boolean)
    : On Error Resume Next
    :
    : Dim winn As Subbb
    : Set winn = New Subbb
    : winn.Visible = True
    : Cancel = True
    : End Sub
    :
    : but i cant figure out how to make the new window go to the selected link.
    :
    : also, when the webpage automaticly wants to open a new window (by following a link that opens a new window) it opens iexplore, and i dont want that.
    :
    : I have tryed to overwrite iexplore.exe with my own exe file, and then uses the command$ to go to the website, however, all i get from the command$ is a "-Embedded", so it seems as that wont work.
    :
    : How can i open a link in a new window and how can i follow a link that opens a new window?
    :
    : Any help about this would be grately appreciate!
    :
    : Thank you!
    :
    : /Christian
    :

  • Ah!
    I see, Thankyou very mutch for your help!
    I was having sutch an headache about this yesterday, but now
    it works just as I want it.

    Thankyou once again for helping me.

    /Christian


    : using [blue]Cancel = True[/blue] completely cancels the navigate action. instead you want to redirect the navigate action to the browser in the new window. to do so, set ppDisp to the webbrowser object that you want to navigate to the new url, and don't cancel the action. when the [b]wb_NewWindow2[/b] process ends, it'll first check to see if [italic]ppDisp[/italic] is a reference to an object, and if so it'll tell that object to navigate to the new url; if not it'll tell the current webbrowser to navigate to the new url. here's the fixed code:
    :
    : [code]
    : Private Sub wb_NewWindow2(ppDisp As Object, Cancel As Boolean)
    : On Error Resume Next
    :
    : Dim winn As Subbb
    : Set winn = New Subbb
    : winn.Visible = True
    : Set ppDisp = winn.wb.Object
    : End Sub
    : [/code]
    :
    :
    :
    :
    : : Hi!
    : : Im having this problem, im trying to make a custom IE webbrowser and i have ran into a problem, i cant right-click and select 'open link in new window', it opens a new window using:
    : :
    : : Private Sub wb_NewWindow2(ppDisp As Object, Cancel As Boolean)
    : : On Error Resume Next
    : :
    : : Dim winn As Subbb
    : : Set winn = New Subbb
    : : winn.Visible = True
    : : Cancel = True
    : : End Sub
    : :
    : : but i cant figure out how to make the new window go to the selected link.
    : :
    : : also, when the webpage automaticly wants to open a new window (by following a link that opens a new window) it opens iexplore, and i dont want that.
    : :
    : : I have tryed to overwrite iexplore.exe with my own exe file, and then uses the command$ to go to the website, however, all i get from the command$ is a "-Embedded", so it seems as that wont work.
    : :
    : : How can i open a link in a new window and how can i follow a link that opens a new window?
    : :
    : : Any help about this would be grately appreciate!
    : :
    : : Thank you!
    : :
    : : /Christian
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories