Solved

Simple Shell??? Question

Posted on 1998-09-27
2
192 Views
Last Modified: 2010-04-30
Hi!

I have a VERY simple question.
I have VB5

I want my program to open up the user's browser, and bring up a homepage.

Thing is, A. We don't know where the browser is, and B. Netscape or INternet Explorer?

I tried a couple of things:
x% = shell("http://whatever.com", Vbwhatever)
will bring up: filenotfound

x% = shell("c:\windows\explorer http://whatever.com", vbwhatever)
This will work, as long as you have IE 4...
I want it to work nomatter what

Please help :)
0
Comment
Question by:eversoslightly
2 Comments
 
LVL 1

Accepted Solution

by:
saam earned 10 total points
Comment Utility
Option Explicit

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 Const SW_SHOW = 5
-------------------------------------------------------------------------------------------------------------------------------

'This will open the url: http://whatever in the system's default browser when the user clicks 'the button named Command1.
Private Sub Command1_Click()
    ShellExecute hwnd, "open", "http://whatever", vbNullString, vbNullString, SW_SHOW
End Sub

/saam
0
 
LVL 1

Author Comment

by:eversoslightly
Comment Utility
Thanks!

Works great.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now