|
-
May 24th, 2000, 12:26 PM
#1
Open Internet Site
I have created an ABOUT BOX for my new program, and have created a command button which, when clicked, I would like it to open a web page. Does anyone know what code I would use?
Please help - I am a COMPLETE beginner!
-
May 24th, 2000, 12:55 PM
#2
Re: Open Internet Site
Use shell function.
Like
shell("c:\windows\explorer http://" & mysite) ' where mysite is any valid url
Hope it will solve your problem
e-mail : [email protected]
Webmaster of (Code Master)
-
May 24th, 2000, 01:08 PM
#3
Re: Open Internet Site
A slightly better approach would be to use the ShellExecute API, because it understands file associations, it will open whichever browser a user has as the default browser.
Place the following code in the General Declarations of a module:
Public 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
Public Const SW_SHOW = 5
Then open the URL like this:
ShellExecute 0, "open", "http://www.yahoo.com", vbNullString, vbNullString, SW_SHOW
Hope this helps,
Chris
-
May 24th, 2000, 02:12 PM
#4
Re: Open Internet Site
You can use the control from :
http://codeguru.developer.com/vb/articles/2070.shtml
- it wraps up all the shellexecute api calls for you and allows you to specify 'behaviour' of the 'url' - all the source code and a sample project is included.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
May 24th, 2000, 08:07 PM
#5
Re: Open Internet Site
Very thorough job! Congratulations on a masterful piece of work! I have been researching a
similar question, and this showed me how much was involved.
Thanks.
Cliff Sather
-
May 25th, 2000, 07:58 AM
#6
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
|