Results 1 to 9 of 9

Thread: [RESOLVED] Send to Webpage

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    246

    Resolved [RESOLVED] Send to Webpage

    Using API, How do I make it popup to what URL they type into a textbox using the default browser?

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: Send to Webpage

    VB Code:
    1. 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
    2.  
    3. Private Sub Command1_Click()
    4. ShellExecute Me.hwnd, "open", Text1.Text, vbNullString, vbNullString, 1
    5. End Sub

  3. #3
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Send to Webpage

    hmm you can make the page show up in internet explorer like
    VB Code:
    1. 'textbox holds [url]http://www.google.com[/url]
    2. Private_Sub Command1_Click()
    3.      Shell "explorer.exe " & Text1.Text
    4. End Sub
    There must be an API to get the default browser location, this thread should be in the API section
    Chris

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    246

    Re: Send to Webpage

    Alright, Thanks...is there anyway that you guys know of w/o using api then?

  5. #5
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Send to Webpage

    The above method works without API but it only lauches the web page from internet explorer, not the default browser, hmm...i'm pretty sure the default web browser is saved in the registry somewhere, so if you could find the registry key (google it) you could simple read the default browser path from the registry and replace the "explorer.exe " with the path
    Chris

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    246

    Re: Send to Webpage

    why wouldnt it be "iexplore.exe"?

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Send to Webpage

    Jmacp show you how to do it with an API (ShellExecute). But if you really don't want to use that (for some reason) this should also work (but it isn't that nice):
    VB Code:
    1. Shell Environ("COMSPEC") & " /c Start " & Text1.Text, vbHide

  8. #8
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Send to Webpage

    If you use iexplore.exe it gives path not found error. It accepts explorer.exe and explorer because explorer.exe is the file which is used to view folders (among other OS things), so when you try to view a folder which is a web page, because windows is by microsoft, they launch their web browser..which as you know is internet explorer
    Chris

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    246

    Re: Send to Webpage

    o ok, thank you

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