HELP!! - Opening Browser in a NEW Window

in visual basic
is there anyway to open the default browser in a NEW window?
instead of opening in an already open window [if there is one open].
thanks
please email me at: irsnort@hotmail.com
irsnortAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JaganMohanCommented:
Try this code
Option Explicit
Const SW_SHOWNORMAL = 1 ' Restores Window if Minimized or

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

Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" _
(ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As _
String) As Long
Private Sub Command1_Click()
    Dim FileName As String, Dummy As String
    Dim BrowserExec As String * 255
    Dim RetVal As Long
    Dim FileNumber As Integer
   
    BrowserExec = Space(255)
    FileName = "C:\temphtm.HTM"

    FileNumber = FreeFile() ' Get unused file number

    Open FileName For Output As #FileNumber ' Create temp HTML file
    Write #FileNumber, " <\HTML>" ' Output text
    Close #FileNumber ' Close file

    ' Then find the application associated with it.
      RetVal = FindExecutable(FileName, Dummy, BrowserExec)
      BrowserExec = Trim$(BrowserExec)
      ' If an application is found, launch it!
      If RetVal <= 32 Or IsEmpty(BrowserExec) Then ' Error

        MsgBox "Could not find a browser"

      Else
        RetVal = ShellExecute(Me.hwnd, "Open", BrowserExec, _
          "www.oracle.com", Dummy, SW_SHOWNORMAL)
        If RetVal <= 32 Then ' Error
          MsgBox "Web Page not Opened"
        End If
      End If

    Kill FileName ' delete temp HTML file
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
irsnortAuthor Commented:
thanks, what i was lookin for
im using vb3 and forgot to add that but ive changed the code a lil bit and its what i need
thanks agian
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.