Results 1 to 8 of 8

Thread: Opening a website, in default browser - is it possible?

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    43

    Opening a website, in default browser - is it possible?

    Hey, I'm just wondering if it's possible if I can open a website in a web-browser using your default browser. VB opens in IE, but I really need it to open in Mozzila Firefox (my default browser)

    If this is possible, how would I be able to make it into a webbrowser in visual basics?

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Opening a website, in default browser - is it possible?

    Use the ShellExecute() API

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    43

    Re: Opening a website, in default browser - is it possible?

    I dont really know what you mean, could you give me a quick example?

  4. #4
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Opening a website, in default browser - is it possible?

    Like so

    VB Code:
    1. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    2.     (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    3.     ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd _
    4.     As Long) As Long
    5.  
    6.   ShellExecute hWnd, "open", "http://www.vbforums.com/", vbNullString, vbNullString, 1

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    43

    Re: Opening a website, in default browser - is it possible?


    I seem to get this error. Even after I put this coding in a completly blank forum

  6. #6
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Opening a website, in default browser - is it possible?

    Code:
    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 sub form_load()
      ShellExecute hWnd, "open", "http://www.vbforums.com/", vbNullString, vbNullString, 1
    End sub

  7. #7

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    43

    Re: Opening a website, in default browser - is it possible?

    Thank you vm

  8. #8
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Opening a website, in default browser - is it possible?

    yeah, no problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width