|
-
Feb 17th, 2006, 09:12 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Send to Webpage
Using API, How do I make it popup to what URL they type into a textbox using the default browser?
-
Feb 17th, 2006, 09:20 PM
#2
Re: Send to Webpage
VB 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 Command1_Click()
ShellExecute Me.hwnd, "open", Text1.Text, vbNullString, vbNullString, 1
End Sub
-
Feb 17th, 2006, 09:20 PM
#3
Re: Send to Webpage
hmm you can make the page show up in internet explorer like
VB Code:
'textbox holds [url]http://www.google.com[/url]
Private_Sub Command1_Click()
Shell "explorer.exe " & Text1.Text
End Sub
There must be an API to get the default browser location, this thread should be in the API section
-
Feb 17th, 2006, 09:27 PM
#4
Thread Starter
Addicted Member
Re: Send to Webpage
Alright, Thanks...is there anyway that you guys know of w/o using api then?
-
Feb 17th, 2006, 09:32 PM
#5
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
-
Feb 17th, 2006, 09:32 PM
#6
Thread Starter
Addicted Member
Re: Send to Webpage
why wouldnt it be "iexplore.exe"?
-
Feb 17th, 2006, 09:35 PM
#7
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:
Shell Environ("COMSPEC") & " /c Start " & Text1.Text, vbHide
-
Feb 17th, 2006, 09:38 PM
#8
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
-
Feb 17th, 2006, 10:10 PM
#9
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|