I am displaying a banner in my prog. and I was wondering how I could force the browser to open any links in a new window?
Printable View
I am displaying a banner in my prog. and I was wondering how I could force the browser to open any links in a new window?
Code:Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim F As New Form1
Set ppDisp = F.webbrowser1.Object
Cancel = False
DoEvents
F.Show
End Sub
This code didnt work. I want a new window, in internet explorer, not my program, to open and display the site which the banner linked to.
This code didnt work. I want a new window, in internet explorer, not my program, to open and display the site which the banner linked to.
'this in your general declarations:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'this in your event that you want to launch the browser from:
Call ShellExecute(hwnddesk, "Open", "www.YourURLHere.com", directory, 0&, vbNormal)
Or without API, simply use the standard Shell method and pass the website as an argument.
Let me clarify what i want. I need code that would open a new internet explorer window when the user clicks the rotating banner on my form, and display which ever link was clicked. I NEED HELP!!!!!!
ST15XA, that will open a new window! Use Megatron's code, it will open a new window always.
Are you wanting to add the Microsoft Internet Controls as a reference so that you can use IE? It would take up resources, but...
Quote:
What the customer wants, the customer gets