Results 1 to 5 of 5

Thread: open webpage in default browser problem [Resolved]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2005
    Posts
    31

    Resolved open webpage in default browser problem [Resolved]

    ok, i want to get a webpage to open up in the default browser when you click a button. i found this code from the codebank.

    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    2.     ByVal hWnd As Long, _
    3.     ByVal lpOperation As String, _
    4.     ByVal lpFile As String, _
    5.     ByVal lpParameters As String, _
    6.     ByVal lpDirectory As String, _
    7.     ByVal nShowCmd As Long) As Long
    8.  
    9. Private Sub OpenURL(strURL As String)
    10.     ShellExecute Me.hWnd, "open", strURL, vbNullString, "C:\", ByVal 1&
    11.     ' Change the last perameter to 0& if you do not whant to show the window.
    12. End Sub

    i cant get this to work. and im wondering if anyone could lend a hand?
    Last edited by Bored Teenager; Jun 11th, 2005 at 05:51 PM.
    Thanks for the help
    - Bored Teenager -

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: open webpage in default browser problem

    Do you get an errors when executing the code?

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

    Re: open webpage in default browser problem

    VB Code:
    1. ShellExecute hWnd, "open", "http://www.google.com/", vbNullString, vbNullString, conSwNormal

  4. #4
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Re: open webpage in default browser problem

    I posted this a few hours ago.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2005
    Posts
    31

    Re: open webpage in default browser problem

    thanks i got it to work with the code ThaRubby supplied.
    Thanks for the help
    - Bored Teenager -

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